From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07D8BC7EE2A for ; Thu, 18 May 2023 20:13:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230108AbjERUNu (ORCPT ); Thu, 18 May 2023 16:13:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229635AbjERUNt (ORCPT ); Thu, 18 May 2023 16:13:49 -0400 Received: from out-24.mta1.migadu.com (out-24.mta1.migadu.com [95.215.58.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A7B710CA for ; Thu, 18 May 2023 13:13:48 -0700 (PDT) Date: Thu, 18 May 2023 16:13:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1684440825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sPKqCx3bzGKXDZMAPxP89wW4PBzj0chsnFR+/Ip42Qo=; b=DluWjkg3LnHQ3zonfUK42JJRluEhv+QrOZp5pYVPshxkvdBvQ2YfK/GUh0iXVR2QW1ejB1 XaoPT2n4TrBbYuAJ0IKf1qHD6RwzcqXbUvqDEtlZELME2OicyU/YKoilAT7mKa+no+R1aq 2azpK45l9IK/ZfZHbtGLvMJ5VtklQsY= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Song Liu Cc: Mike Rapoport , linux-mm@kvack.org, Andrew Morton , Dave Hansen , Peter Zijlstra , Rick Edgecombe , Thomas Gleixner , Vlastimil Babka , linux-kernel@vger.kernel.org, x86@kernel.org Subject: Re: [RFC PATCH 1/5] mm: intorduce __GFP_UNMAPPED and unmapped_alloc() Message-ID: References: <20230518152354.GD4967@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 18, 2023 at 01:03:28PM -0700, Song Liu wrote: > If we use compound_order(), we will round up to power of 2 for all > allocations. Does this mean we will use 4MiB for a 2.1MiB allocation? Yes. This means we lose on average 33% - I believe, someone with better statistics might correct me - to internal fragmentation. But the buddy allocator will be better at avoiding and dealing with external fragmentation over time.