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 4EFCA14E2FA for ; Wed, 27 Mar 2024 17:53:42 +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=1711562023; cv=none; b=ISfT/tUSI8BM7fWhi/Sz4iu80v+MHm90mdBGFs9fornKXeMIh79mJNTvZ4uWVfaSsrP6cSCtXhJ4b1xgQVKnU3u2MQmKNSUGOO5CtbyZxnInHJw4W9OZpsVngpKKqjS+6b/CwXPhRPA8A4DDjrKR/1Qu33/RIbk9VvWkCh+U2x8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711562023; c=relaxed/simple; bh=9QfCm7TQMQIKAN4FfKKADTKYHzgeLxAkYWbju47iwEw=; h=Date:To:From:Subject:Message-Id; b=LJWC5v5n6ew8JftLVjPxvQIkO+/xdno2GkzaeaYzYMrSLhh4WIxtPz3G2sg9oo4UES96QlReUlFbVaGqwVoZHuf60h55k7vooUcFiOQO2zfEd8SOoZTu+n1cLgyISmNQUAdmD5tyPAjjz4DEUOaaA2iku5IdVwwY+sMBf5hnrUc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=ETe/tyuJ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="ETe/tyuJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9991C433F1; Wed, 27 Mar 2024 17:53:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1711562022; bh=9QfCm7TQMQIKAN4FfKKADTKYHzgeLxAkYWbju47iwEw=; h=Date:To:From:Subject:From; b=ETe/tyuJMtR1FdMOQqsofKRtp0GBWO1eJPui7ejnkjL6wB6jDYiyaj5qaz2FTOmog q0ArrPY4u4pYpR16rkc1Iv2ZgSyKpmZv+X32r7UuUUyi/9TIGNmgTXr2CAyccWc6Sg sRB5sfpo82zuniWQ9D6kocCfwhhOYh5RMxS/nZsw= Date: Wed, 27 Mar 2024 10:53:42 -0700 To: mm-commits@vger.kernel.org,willy@infradead.org,vbabka@suse.cz,shy828301@gmail.com,rppt@kernel.org,riel@surriel.com,muchun.song@linux.dev,mpe@ellerman.id.au,mike.kravetz@oracle.com,lstoakes@gmail.com,kirill@shutemov.name,jthoughton@google.com,jhubbard@nvidia.com,jgg@nvidia.com,hch@infradead.org,david@redhat.com,christophe.leroy@csgroup.eu,axelrasmussen@google.com,aneesh.kumar@kernel.org,andrew.jones@linux.dev,aarcange@redhat.com,peterx@redhat.com,akpm@linux-foundation.org From: Andrew Morton Subject: + mm-make-hpage_pxd_-macros-even-if-thp.patch added to mm-unstable branch Message-Id: <20240327175342.C9991C433F1@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The patch titled Subject: mm: make HPAGE_PXD_* macros even if !THP has been added to the -mm mm-unstable branch. Its filename is mm-make-hpage_pxd_-macros-even-if-thp.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-make-hpage_pxd_-macros-even-if-thp.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Peter Xu Subject: mm: make HPAGE_PXD_* macros even if !THP Date: Wed, 27 Mar 2024 11:23:22 -0400 These macros can be helpful when we plan to merge hugetlb code into generic code. Move them out and define them as long as PGTABLE_HAS_HUGE_LEAVES is selected, because there are systems that only define HUGETLB_PAGE not THP. One note here is HPAGE_PMD_SHIFT must be defined even if PMD_SHIFT is not defined (e.g. !CONFIG_MMU case); it (or in other forms, like HPAGE_PMD_NR) is already used in lots of common codes without ifdef guards. Use the old trick to let complations work. Here we only need to differenciate HPAGE_PXD_SHIFT definitions. All the rest macros will be defined based on it. When at it, move HPAGE_PMD_NR / HPAGE_PMD_ORDER over together. Link: https://lkml.kernel.org/r/20240327152332.950956-4-peterx@redhat.com Signed-off-by: Peter Xu Cc: Andrea Arcangeli Cc: Andrew Jones Cc: Aneesh Kumar K.V (IBM) Cc: Axel Rasmussen Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David Hildenbrand Cc: James Houghton Cc: Jason Gunthorpe Cc: John Hubbard Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Matthew Wilcox (Oracle) Cc: Michael Ellerman Cc: Mike Kravetz Cc: "Mike Rapoport (IBM)" Cc: Muchun Song Cc: Rik van Riel Cc: Vlastimil Babka Cc: Yang Shi Signed-off-by: Andrew Morton --- include/linux/huge_mm.h | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) --- a/include/linux/huge_mm.h~mm-make-hpage_pxd_-macros-even-if-thp +++ a/include/linux/huge_mm.h @@ -64,9 +64,6 @@ ssize_t single_hugepage_flag_show(struct enum transparent_hugepage_flag flag); extern struct kobj_attribute shmem_enabled_attr; -#define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT) -#define HPAGE_PMD_NR (1<