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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 10445F3C263 for ; Mon, 9 Mar 2026 13:44:35 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4fTytB2j75z309P; Tue, 10 Mar 2026 00:44:34 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2600:3c0a:e001:78e:0:1991:8:25" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1773063874; cv=none; b=ou8t0MVj7kkgTvIdk5y2JZocnKX4xZ4AHEiBuJR2enqUf/5tGRRx2SgHDetUD5V9jolMz0zAjnt04ccH8sYvB6CDWGL87iq9jx0jer0v/oYGKfJPQybkUc5K3Y2shAoBJdFXxwYxcx/+aTrflyvli1nsbiwrfb0cU1s2/Ht7opUnLiimy20Ms6KO/1gGqJnnZWXtiVTtgekR9dIB0F19mcfxkB6mPeREY5gtGEf8990aP6npKMAEP0KtnS/25Li48pgGcXqNeO6e8Aqfey8a7tFbJOgnuB0sKs8zAO5BvDaQJHBY/ep8XxK5zdLYTms39h8OSXzPSK8llhNyufqKsw== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1773063874; c=relaxed/relaxed; bh=uff3YTCVgqsL1iOsrMf8mkfHZ5TV2mh1epm2NrmtkBo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LdPNyM6Yunda7HdNrVOH1pkWbOLP0XNC7gj4zA9kACcIfvaPjhWZLZ1fl2vZTV5mQYJAPfZSbPjtdIJ2Jp1iDxJi6s8GRxx+6oeK7xmktPJby8hZqcsZJ+XOfLUauiCRggBS4UXOvTm7PBwuyBxUqWOG9a0hUhsS+YfAKRybZqMrh+Uc72DGbS2Re1JGUWCsMuvY0QWj+G3AYh5qT1byZLYQ6oOcwxKUzRlMzyOTTCTCDC41flHkql9gKHZUHl933PzNqfjnuiqXs1LCXhoEaKO6HiCXK7nE3XYxMs6Gyvl19Tt2hwey/3lNIyFrrdfnJc+e79piNJxwv+qtZuK3yg== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=ktkuMurA; dkim-atps=neutral; spf=pass (client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org; envelope-from=ljs@kernel.org; receiver=lists.ozlabs.org) smtp.mailfrom=kernel.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=ktkuMurA; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org; envelope-from=ljs@kernel.org; receiver=lists.ozlabs.org) Received: from sea.source.kernel.org (sea.source.kernel.org [IPv6:2600:3c0a:e001:78e:0:1991:8:25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4fTyt95jN9z2ySb for ; Tue, 10 Mar 2026 00:44:33 +1100 (AEDT) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id B6E7943AA0; Mon, 9 Mar 2026 13:44:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A0E8C4CEF7; Mon, 9 Mar 2026 13:44:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773063871; bh=uff3YTCVgqsL1iOsrMf8mkfHZ5TV2mh1epm2NrmtkBo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ktkuMurADMf50LRwnbfN1+AJYnRdWEKFnD0sMhwDV9Qk044EpO1RsQJsCoizrusOH 29xj82RiF2RGwBmdLo0pT1VS7qJ3vVYUADrzug3p/vxCwbDuYsVlwT/lBGSbDErk6i jQQ7gSkUXIIKvzOHZvXIfbiAnGOw0RzQuf5WfliG+/4nCwo0/ZTHFwAxYz7AVV9zfS cytQdTnyw2vmLaFn52/q2fbpgQx2Xo/cj564DX6jwd7rYX7iewz6O+qlDY4gqp3XCw y+PT9/CRU6M4iy9jhNd7YbUOjYayHZY8BYlakH7GFo0MVgJRM/PgAPyZ4xzCMcAdOE WqUuFknTpY37Q== Date: Mon, 9 Mar 2026 13:44:27 +0000 From: "Lorenzo Stoakes (Oracle)" To: "David Hildenbrand (Arm)" Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, Dan Williams Subject: Re: [PATCH v1 1/4] mm: move vma_kernel_pagesize() from hugetlb to mm.h Message-ID: <27d52c59-e68f-4369-b133-4db71e1de0c6@lucifer.local> References: <20260306101600.57355-1-david@kernel.org> <20260306101600.57355-2-david@kernel.org> <833950ef-e01d-4914-b5f9-bc1f6261b184@lucifer.local> <729e14d4-6949-4d46-9380-12331b5ad363@kernel.org> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <729e14d4-6949-4d46-9380-12331b5ad363@kernel.org> On Fri, Mar 06, 2026 at 02:25:51PM +0100, David Hildenbrand (Arm) wrote: > On 3/6/26 12:07, Lorenzo Stoakes (Oracle) wrote: > > On Fri, Mar 06, 2026 at 11:15:57AM +0100, David Hildenbrand (Arm) wrote: > >> In the past, only hugetlb had special "vma_kernel_pagesize()" > >> requirements, so it provided its own implementation. > >> > >> In commit 05ea88608d4e ("mm, hugetlbfs: introduce ->pagesize() to > >> vm_operations_struct") we generalized that approach by providing a > >> vm_ops->pagesize() callback to be used by device-dax. > >> > >> Once device-dax started using that callback in commit c1d53b92b95c > >> ("device-dax: implement ->pagesize() for smaps to report MMUPageSize") > >> it was missed that CONFIG_DEV_DAX does not depend on hugetlb support. > >> > >> So building a kernel with CONFIG_DEV_DAX but without CONFIG_HUGETLBFS > >> would not pick up that value. > >> > >> Fix it by moving vma_kernel_pagesize() to mm.h, providing only a single > >> implementation. While at it, improve the kerneldoc a bit. > >> > >> Ideally, we'd move vma_mmu_pagesize() as well to the header. However, > >> its __weak symbol might be overwritten by a PPC variant in hugetlb code. > >> So let's leave it in there for now, as it really only matters for some > >> hugetlb oddities. > >> > >> This was found by code inspection. > >> > >> Fixes: c1d53b92b95c ("device-dax: implement ->pagesize() for smaps to report MMUPageSize") > >> Cc: Dan Williams > >> Signed-off-by: David Hildenbrand (Arm) > > > > LGTM, but you need to fix up VMA tests, I attach a patch below to do this. Will > > this resolved: > > Thanks! > > I assume that should go into patch #2 instead? (Sorry missed this on first reply) It doesn't matter too much from compilation point of view but thought it made more sense as this is where you pull vma_kernel_pagesize() in? But I'm fine with either! Cheers, Lorenzo