From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta0.migadu.com (out-234.mta0.migadu.com [91.218.175.234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 82F052F746D for ; Sat, 15 Aug 2026 14:12:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.234 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786803145; cv=none; b=LbDypkw1k5ZpozU55B6OuWoklNwVko2bj+g9AqerF+tK3xgLY3zfN3xQeIQ3wqit2z6JHtmvMhxJ9tg+NyjxAR4JeRykCKosfxDkMP968++KfLbzlMBGHf8Eay8trSPSwJQq2PiHee+3Xn3lqz5mB0y3FxMW0qiFvVsdk7kxoTk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786803145; c=relaxed/simple; bh=2pSAzOc521eM8MMUWAwepyHjyA8he2kR0aSHgrLA2RE=; h=Mime-Version:Content-Type:Date:Message-Id:From:To:Cc:Subject: References:In-Reply-To; b=byTJx6ZWZsLVp34bJLaytITY0WNLBYXTceT63Tzwk8zNdPR9JBptsZOox/2DjmSgI3AQL6gyA2/uQZjOztGXgb1lsFhJk8PuizFqxguvXoV3jnJBneKgvA20OL85H0NVcD+0LCONXN9jJIxljMWhEA6XwWejrG6f6Eu+PhSnVWg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=oO35hbFo; arc=none smtp.client-ip=91.218.175.234 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="oO35hbFo" X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=2pSAzOc521eM8MMUWAwepyHjyA8he2kR0aSHgrLA2RE=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1786803140; v=1; x=1787407940; b=oO35hbFo/ErXscONn67gzt+dz8S+Psv+RpqJZGNn252F6lCKhshBp1ye+FTKxUzgB/E0kwdd jkyAzjwEUHgv6IfnaYEWUChFVbSEEZv98n8Y65oGRaldyMH1nS7sxERdHJTsnucuxdL0QGYxuzM i+PBfzpHud/h24leU6Cm/lT0= X-Envelope-To: linux-kernel@vger.kernel.org Received: from localhost (77.97.51.77) by smtp.migadu.com with ESMTPS id 685b1f35c1f5c486; Sat, 15 Aug 2026 14:12:10 +0000 X-Migadu-Flow: FLOW_OUT Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sat, 15 Aug 2026 15:12:09 +0100 Message-Id: From: "Brendan Jackman" To: "Vlastimil Babka (SUSE)" , "Borislav Petkov" , "Dave Hansen" , "Peter Zijlstra" , "Andrew Morton" , "David Hildenbrand" , "Mike Rapoport" , "Wei Xu" , "Johannes Weiner" , "Zi Yan" , "Lorenzo Stoakes" Cc: , , , "Sumit Garg" , "Will Deacon" , , , "Itazuri, Takahiro" , "Andy Lutomirski" , "David Kaplan" , "Thomas Gleixner" , "Yosry Ahmed" , "Patrick Bellasi" , "Reiji Watanabe" , "Sean Christopherson" Subject: Re: [PATCH v3 21/26] mm/page_alloc: implement FREETYPE_UNMAPPED allocations X-Mailer: aerc 0.21.0 References: <20260726-page_alloc-unmapped-v3-0-6f5729aa9832@google.com> <20260726-page_alloc-unmapped-v3-21-6f5729aa9832@google.com> In-Reply-To: On Mon Aug 3, 2026 at 10:18 AM BST, Vlastimil Babka (SUSE) wrote: >> +/* >> + * Can pages of these two freetypes be combined into a single higher-or= der free >> + * page? >> + */ >> +static inline bool can_merge_freetypes(freetype_t a, freetype_t b) >> +{ >> + if (freetypes_equal(a, b)) >> + return true; >> + >> + if (!migratetype_is_mergeable(free_to_migratetype(a)) || >> + !migratetype_is_mergeable(free_to_migratetype(b))) >> + return false; >> + >> + /* >> + * Mustn't "just" merge pages with different freetype flags, changing >> + * those requires updating pagetables. >> + */ >> + return freetype_flags(a) =3D=3D freetype_flags(b); >> +} >> + >> /* >> * Freeing function for a buddy system allocator. >> * >> @@ -1069,9 +1090,7 @@ static inline void __free_one_page(struct page *pa= ge, >> buddy_ft =3D get_pfnblock_freetype(buddy, buddy_pfn); >> buddy_mt =3D free_to_migratetype(buddy_ft); > > There's a comment above this that should probably be moved to > can_merge_freetypes() as well? True, thanks.