From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 34B292DA75B for ; Mon, 11 May 2026 16:58:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778518735; cv=none; b=QQnUmHSZjVdfngejm4lXE6R2O2Oib2FzagMJnfQyDC6k0Dk8iNaJj4yVEDzz6vBQR9ddVpuVRy3ZI3/jm9DZBz2ywAacy1l8JHLMjJ+aG5zpCn3/QM1slUlbV/kSS+3mdNfhhAzlg2EdS3v3DGb0w4S8eY3xmQIndF4xAT0ppYU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778518735; c=relaxed/simple; bh=O6u/tdsx3GUXSNNLyrJ9hKvN+wQ3uWRAHq+zudrygTc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=L4vInt/OE0SKoeHg0pI5HGoVPY71k0cFrlA9w6rqXCGaHDKkn7ZTouddXEHVfMQWo0mBlQsPEROglqAyfBAt0Y1egG/MXemJeMyO3/df66rW5siaobugfpDpoSC6luHUiz2XX/KFRCk00JxLcCW6blQWPnuXkUFHF0ejHXorKtg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IWi4+eNE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IWi4+eNE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE7CAC2BCB0; Mon, 11 May 2026 16:58:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778518734; bh=O6u/tdsx3GUXSNNLyrJ9hKvN+wQ3uWRAHq+zudrygTc=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=IWi4+eNEZjgT9drcZu+/r8N1ndrdAgICycZQz80OUeOEfU15tX7MQDhAQGaKAtuWI F9rROCcdcXGTCrAQGngEPn8azYdMALOotyTB9CDBOj+20BlinGxUuWmdm75BibVUlS ZO0YGA571hSUcD+0/2HHE+xHuewUfsRbm09piUPClIy4PKk3xyOyv+yKdtEMEQct6G G5ARu7xR6huF9EEqpq+foAupdAiWdZbH79bA84UAe1TMuxqh3kdwg2wNTQ6mli44Ke pcsUd4pY8pOLMdqDU8B7GULudJuZ95SLPiYKPw+hl0GGWpXbGzbjDfp2HV1iPoriYn M5dHAcAKSGvUw== Message-ID: Date: Mon, 11 May 2026 18:58:48 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 10/22] mm: introduce freetype_t Content-Language: en-US To: Brendan Jackman , Borislav Petkov , Dave Hansen , Peter Zijlstra , Andrew Morton , David Hildenbrand , Wei Xu , Johannes Weiner , Zi Yan , Lorenzo Stoakes Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, x86@kernel.org, rppt@kernel.org, Sumit Garg , derkling@google.com, reijiw@google.com, Will Deacon , rientjes@google.com, "Kalyazin, Nikita" , patrick.roy@linux.dev, "Itazuri, Takahiro" , Andy Lutomirski , David Kaplan , Thomas Gleixner , Yosry Ahmed References: <20260320-page_alloc-unmapped-v2-0-28bf1bd54f41@google.com> <20260320-page_alloc-unmapped-v2-10-28bf1bd54f41@google.com> <016c8bef-57ef-44ef-bf60-86dbfd368dcd@kernel.org> From: "Vlastimil Babka (SUSE)" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 5/11/26 18:49, Brendan Jackman wrote: > On Mon May 11, 2026 at 3:34 PM UTC, Vlastimil Babka (SUSE) wrote: >>> +/** >>> + * __get_pfnblock_freetype - Return the freetype of a pageblock, optionally >>> + * ignoring the fact that it's currently isolated. >>> + * @page: The page within the block of interest >>> + * @pfn: The target page frame number >>> + * @ignore_iso: If isolated, return the migratetype that the block had before >>> + * isolation. >>> + */ >>> +__always_inline freetype_t >> >> 'static' too? > > Yup thanks > >> >>> +__get_pfnblock_freetype(const struct page *page, unsigned long pfn, >>> + bool ignore_iso) >>> +{ >>> + int mt = get_pfnblock_migratetype(page, pfn); >>> + >>> + return migrate_to_freetype(mt, 0); >>> +} >>> + >>> +/** >>> + * get_pfnblock_migratetype - Return the freetype of a pageblock >>> + * @page: The page within the block of interest >>> + * @pfn: The target page frame number >>> + * >>> + * Return: The freetype of the pageblock >>> + */ >>> +__always_inline freetype_t >> >> And this is declared in a header so the __always_inline is not really >> applicable? > >> (seems we should fix up get_pfnblock_migratetype too) > > Um, I think it probably still forces inlining in calls within the same > translation unit? True but I don't think we try to do that consciously, seems like it was just an oversight for get_pfnblock_migratetype, maybe Zi Yan remembers? > Anyway I am pretty meh about this, I suspect humans and compilers are > equally bad at making this decision, I was just trying to be consistent > with the code it's replacing. True.