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 967F0F41807 for ; Mon, 9 Mar 2026 15:19:17 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4fV0zR6z28z309P; Tue, 10 Mar 2026 02:19:15 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2600:3c04:e001:324:0:1991:8:25" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1773069555; cv=none; b=PGsHAcPCqENRu3jn/0B4bTvQyif8Kdesg3Ja81aSPk2xH0IPtHIh7gK/pQNK0WP+bn30EeTrtjHc3HamLL81oFdKNC8Bmc5WhDKRUXchww9h2yLMo+x3QHTdtt5DSFKfWxAAKZ2EGhPgKnPDIif1n3oljmGnLu1SalmXrfaudQ6RbM5NlPXYWUqFOrGlc578yPQYsk8526hzlH8+rex+jP5DFtCaj96cOMdv3cWyJFjSnKegWmDFWoDqsUcUYH9/lcftxAw/kYG/b1n70aqurVCeeH2fkdIfyFJMOajEOv0m0ZtUgfIIHFx/haHzWfwIjSxECjJKYhUfSC59t6GbTg== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1773069555; c=relaxed/relaxed; bh=13W3+3LFMinj6FPLvnxSJnn9lYgENZeNMmdBWOMyKC0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=kBkOrlFSv92ILWNb4/FEhoEfhjI6G7Kd7+0B7o82q7qg1HJl4I7Ab40oTx6Ach1iazHx020p1GjTGHGmwo5Xe4b9LrMe8mIfQb8yW2qR4daqTYKMX66UO2cf8JKs5r8yiMmDPHMeyrOb8kXha6OOpgRfnW9xqTkTmPulT2Y5odfAocUvoDLxu4skQZp9Z7Tb/ulm3eI6aLTCxE/Hr8sUQXD/qXPjevfwCG3b1JzRp7XiKSgP6s74r2DttQC7RS2CDKtZCLXNbq2vY/Qd7yu9RdjnJLsufz/tT3fzgifgEWc/i7IQe2mjGaBpIuhqxRQzc0VG6gqaHJRTSFU8N4NZTw== 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=l1HYB2V0; dkim-atps=neutral; spf=pass (client-ip=2600:3c04:e001:324:0:1991:8:25; helo=tor.source.kernel.org; envelope-from=david@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=l1HYB2V0; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=2600:3c04:e001:324:0:1991:8:25; helo=tor.source.kernel.org; envelope-from=david@kernel.org; receiver=lists.ozlabs.org) Received: from tor.source.kernel.org (tor.source.kernel.org [IPv6:2600:3c04:e001:324:0:1991:8:25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4fV0zR05tGz2xm3 for ; Tue, 10 Mar 2026 02:19:14 +1100 (AEDT) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id D639460054; Mon, 9 Mar 2026 15:19:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9A9EC2BC86; Mon, 9 Mar 2026 15:19:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773069552; bh=U/h2huN/IK33EUYYoVbeCNOLTX65WGNBH1yEJmt4qPQ=; h=From:To:Cc:Subject:Date:From; b=l1HYB2V04oJ/S42Zu9JUsjv5Owzl7dWIJVg9XjlpPgIAXwhiZ81EH5q+dmoG8nVzW xKsIZQ0B9wi04tzX/z93YqUCHDJyEHEwxG4VlhASvbttYe7KGDuSCXkCLxBOhnpJY5 nYGMxzAJSQYtcmc82vcKd8/t+YmFKoNv+3huhkBL7y2Psz1c6sncJwBqMSLrJbdDxw d7KraB89RTyGWDDFgnObhpEIBcPuRjdrpSHqBWlf3lqg1I4xb5kZ1dXqVEVCaClf/y YCZDuxk4gPWFoBjI5H/fFusUYLrVRRL0VEiQCJ5LAMe9ThZsh5l2H8AzQ83CNCDS+d gQvEe4ITMwnGQ== From: "David Hildenbrand (Arm)" To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, "David Hildenbrand (Arm)" , Andrew Morton , Madhavan Srinivasan , Nicholas Piggin , Michael Ellerman , "Christophe Leroy (CS GROUP)" , Muchun Song , Oscar Salvador , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Jann Horn , Pedro Falcato , Paolo Bonzini , Dan Williams Subject: [PATCH v2 0/4] mm: move vma_(kernel|mmu)_pagesize() out of hugetlb.c Date: Mon, 9 Mar 2026 16:18:57 +0100 Message-ID: <20260309151901.123947-1-david@kernel.org> X-Mailer: git-send-email 2.43.0 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-Transfer-Encoding: 8bit Looking into vma_(kernel|mmu)_pagesize(), I realized that there is one scenario where DAX would not do the right thing when the kernel is not compiled with hugetlb support. Without hugetlb support, vma_(kernel|mmu)_pagesize() will always return PAGE_SIZE instead of using the ->pagesize() result provided by dax-device code. Fix that by moving vma_kernel_pagesize() to core MM code, where it belongs. I don't think this is stable material, but am not 100% sure. Also, move vma_mmu_pagesize() while at it. Remove the unnecessary hugetlb.h inclusion from KVM code. Cross-compiled heavily. v1 -> v2: * Fixup VMA test in patch #2 * Actually CC all people listed below on all patches. Cc: Andrew Morton Cc: Madhavan Srinivasan Cc: Nicholas Piggin Cc: Michael Ellerman Cc: "Christophe Leroy (CS GROUP)" Cc: Muchun Song Cc: Oscar Salvador Cc: Lorenzo Stoakes Cc: "Liam R. Howlett" Cc: Vlastimil Babka Cc: Mike Rapoport Cc: Suren Baghdasaryan Cc: Michal Hocko Cc: Jann Horn Cc: Pedro Falcato Cc: Paolo Bonzini Cc: Dan Williams David Hildenbrand (Arm) (4): mm: move vma_kernel_pagesize() from hugetlb to mm.h mm: move vma_mmu_pagesize() from hugetlb to vma.c KVM: remove hugetlb.h inclusion KVM: PPC: remove hugetlb.h inclusion arch/powerpc/kvm/book3s_hv.c | 1 - include/linux/hugetlb.h | 14 -------------- include/linux/mm.h | 22 ++++++++++++++++++++++ mm/hugetlb.c | 28 ---------------------------- mm/vma.c | 21 +++++++++++++++++++++ tools/testing/vma/include/custom.h | 5 +++++ virt/kvm/kvm_main.c | 1 - 7 files changed, 48 insertions(+), 44 deletions(-) base-commit: f75825cdfc4c5477cffcfd2cafa4e5ce5aa67f13 -- 2.43.0