From patchwork Thu Mar 21 22:07:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 13599408 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8386C6FD1F for ; Thu, 21 Mar 2024 22:08:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2EE426B0098; Thu, 21 Mar 2024 18:08:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2266B6B0099; Thu, 21 Mar 2024 18:08:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ED01C6B009A; Thu, 21 Mar 2024 18:08:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id D7E336B0098 for ; Thu, 21 Mar 2024 18:08:16 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id B1083C0786 for ; Thu, 21 Mar 2024 22:08:16 +0000 (UTC) X-FDA: 81922435392.27.341A6B3 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf26.hostedemail.com (Postfix) with ESMTP id 82BC0140010 for ; Thu, 21 Mar 2024 22:08:14 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ddEbQRS7; spf=pass (imf26.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711058894; a=rsa-sha256; cv=none; b=TujrFyTcbZig9X2h2bdMYNmySSCbEKdlMwQEkh6+ZWdVSeJAbvAFPrTKAK8cA0mvTur0gf po5bx5nq6Yw+N5MRFSXYDB8C62jG6xqYnYIVSCQ7abPSWmDjRtOK1JRAH/wpQv1VYDKpTZ ONsrsIiYCgejCVD9Lro9rpmDD/joxUw= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ddEbQRS7; spf=pass (imf26.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711058894; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=wdRUTOTGji9K1EOtUzCYNHXUg1STGKkafiwUdqA6oYA=; b=gZw10/VjODm4ODLB07w1fjU2LDzOOgF/FmhpMeiiPpatRLz8l+Ey7HCrJYcG8x+PcsPcs1 AKUaefuTv141Sdu4K8o5wM85TbCQtZpqAy8UHP4jRnEqs2mgfl8af8y/NFwnrmjwC1TKC0 Px6whJ00wlOoLdBQu8Vh9GO0i1C1c6c= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711058893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wdRUTOTGji9K1EOtUzCYNHXUg1STGKkafiwUdqA6oYA=; b=ddEbQRS7uISRVpiE543XZzi76iOwqW75Ahq9OpyxnA4p7RAtKWfYimvu9giRHxIXv1lSeG FwmMHbjjH/SueJq9l4PB75WWNQNbpI3vOjhMoH1iiFewI0pLk6+AwYIhrJLf3T7ysiC/8l MO5Ao+4uqii5sZIjbsGBImV1lzH6cOo= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-107-A0gY0vJCPoCJ4wF7xAmkzQ-1; Thu, 21 Mar 2024 18:08:12 -0400 X-MC-Unique: A0gY0vJCPoCJ4wF7xAmkzQ-1 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-69651ab4c4fso3556766d6.0 for ; Thu, 21 Mar 2024 15:08:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711058891; x=1711663691; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wdRUTOTGji9K1EOtUzCYNHXUg1STGKkafiwUdqA6oYA=; b=O7d+36YGdI7Cvq/A1yR/Ur5dPIDYiOMYXxgvfXwiMzx7es1oOjiGQ+FebKKoRsYNsa qUpw9wkqgQQps53Xa8K1IntTzrEtX53nlabMTT0my5IqpAUTuA2vvrjnwEXnwdQvDYne Tuu/7aFQRa2f9pZfkqKgW08TPiZOHfe27+jranxfHPT62MD1Nr2uBCebntj9EADw605J umvB64dRlLp+YVe9szBuSKlevhMNbn1S/3KDFqCPPSnMOlvotp/AY1Er1D0OgMnxifgh BSK88MPRBN1NX61aTtTnd+0nn79VGz3/TL9HPuk3w5/tbeaAI3APuxV8MA0SHD5rMpip hxiw== X-Gm-Message-State: AOJu0YwW5MTljYyjBYvhm+tjHJWhYbhnPiQj+hOFEI1HX/+2Z3uWyKe3 ZYQHM4y4Xr4ll2/NOkirvJasjoF7NGln8yPURaWlkjNAEpeE0llHf7+7SteMkfmw48RvbfrH8bk S8RqrjBsmJ/G0d1WvxEQqdJnyWoD2Zq6e/TnG8fliml/IME/Re+CBvY4bcvIbRC9bWpy+eQuniJ RU0IsXxiI7wdewIfVGnRT4meVsUM8L4w== X-Received: by 2002:a05:6214:3a8a:b0:690:3c85:c5b with SMTP id nz10-20020a0562143a8a00b006903c850c5bmr195583qvb.3.1711058891453; Thu, 21 Mar 2024 15:08:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG16ns9jJ9MJ80ThL7hh1B1qvLdYLgSNyXX5iyvBQC6076/qVHetDei+F5v2+719IrZ5asQ9g== X-Received: by 2002:a05:6214:3a8a:b0:690:3c85:c5b with SMTP id nz10-20020a0562143a8a00b006903c850c5bmr195527qvb.3.1711058890838; Thu, 21 Mar 2024 15:08:10 -0700 (PDT) Received: from x1n.redhat.com ([99.254.121.117]) by smtp.gmail.com with ESMTPSA id o6-20020a0562140e4600b00690baf5cde9sm351663qvc.118.2024.03.21.15.08.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 15:08:10 -0700 (PDT) From: peterx@redhat.com To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, Michael Ellerman , Christophe Leroy , Matthew Wilcox , Rik van Riel , Lorenzo Stoakes , Axel Rasmussen , peterx@redhat.com, Yang Shi , John Hubbard , linux-arm-kernel@lists.infradead.org, "Kirill A . Shutemov" , Andrew Jones , Vlastimil Babka , Mike Rapoport , Andrew Morton , Muchun Song , Christoph Hellwig , linux-riscv@lists.infradead.org, James Houghton , David Hildenbrand , Jason Gunthorpe , Andrea Arcangeli , "Aneesh Kumar K . V" , Mike Kravetz Subject: [PATCH v3 03/12] mm: Make HPAGE_PXD_* macros even if !THP Date: Thu, 21 Mar 2024 18:07:53 -0400 Message-ID: <20240321220802.679544-4-peterx@redhat.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240321220802.679544-1-peterx@redhat.com> References: <20240321220802.679544-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 82BC0140010 X-Stat-Signature: wfpa4updnfn84tuxyrs9er5t7qqcobsk X-Rspam-User: X-HE-Tag: 1711058894-778346 X-HE-Meta: U2FsdGVkX18JGfVKsqA6c2gd30S+IBaIqkIXLmFQ0St2h9JaKBsqTB63Lm49YNtF6QmafVOOyCBlYLoSJUqhf8w/6OacJfiuCJlBAYip7zr59eVn4fg1A2RuiGB894+6xemMK9bn5XAeKWAWT6OUSMZ3Kx5Pau2mFixgqsMk53lkvLLB0FKr1qK8jq+Ja0hS7drVuEyhjfe1eFj94A4QoYroClHTQiyj21KEdbw009yyfzzjZ+RZS67FR0RkY96WezABJf46dGN9qLHAOkjOaYEylfLEzPKlnxUpgnEjJcgoEDdDX5BoR3jtyuIUmnRFlRtXQiz1aYoe1yiqjqN6/li64x9qbYSRrb630ttBRgiu3ME+6lBCmkEPc8uwiXk2tG5fuU7mEMfxT5vjhkSNisBZRR/v6w7dymEc2WSo8g5XSH1jDFdlarTryVIdIthNAofem0YG3WHZp66/uzNa4JJJhAcj8Vx5coGRGuERYHxiBclD8DO22LmPtG340jR0slqgHw6MAGTschcfyOZlHvSL30QQciq6F2g+LW5V/uY7uCM3XVcphDrv+Merhzkt+3xFWuWB2Txcm7LG7q4wkZkVT8Yo/2MImpJukMZHZnZOd88CTs85+U9KFwe/r7BvtC1meYr3Ch7InAF2yDAPB/VPdwb9Itdq7pFxENC5c5SZORQA/DbQT/guUQ4gTGm1d4HQOKxT+YU/IAy/v6NtTWvBDHhwZpG+Q90vM7jUzT7sczxSG9dA7qeQ2iXTVfjDei3TczcwK5nZX6jmrTLsKi6tFQnOgM+ReGOO6M80YuyABi5r1RetFK/utZ6SYD1DAtzygPGafHE//dqRQWmy5KEvbOsnlQtWqD9u4+W4IbJ/l2JWpCZLhOwwaDU+Es2r8uUFU/RrusEkGlKC8U5t79XKop7A3QFyEPE6m3r41laNwXLKiAE3iYsVORP72mxCDYPk7uCO34GM6D67HxG RLKsCUr0 Pcp+RoIV2EUOWwfyauQ4ZBIx74WICZ22IkmlFLh0soefJ/dK2zUkMFk9ibWzJZHYGr72xkmfO2S9pqwYwvM0SSamJcywXXPhwz2FVHKLhVNJGs7T7VeoUcsrmowX+lADcZ3sF9MOF+MQtTbPNJ020Jc7Tk/WoL/S8X9KIL4EyxdtyfaQjetubynMbKoQz3ia5mJSESudy6BplwLTBXfuMA7SHWKUJHKjbDjDFoDwJz1ctEPKlt1pkUxYGSqveEhMqF4698vQeEGqhoOzntu84t+E89xHFioNZBsDY9vedhrA9EO7WfVGuxxCu64HPixZWaSuMaJZH9cejdBeZJ5Nj5SOayEAakSsbCjHy3DTmJqgLFY0JUYDtWO7dXsJkzk+1g7CJaBdn31q1+CeAO/jDfJlq3E0CIQf3hoQ4cp/SxeAq8ckOhNRmhs7qLxdpHM6hXgiMdR7AmgmmDYtePbUzTFpKzx3qeU6EyFEFzTD7buJa3gW4K4YsXW3pSfy9dV1E09bJaO2uHWu1L4xmRNfcsdgOsLyqm9xK45omumBFh6RcZ9Q8lQu8GDpcPg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Peter Xu These macros can be helpful when we plan to merge hugetlb code into generic code. Move them out and define them even if !THP. We actually already defined HPAGE_PMD_NR for other reasons even if !THP. Reorganize these macros. Reviewed-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Signed-off-by: Peter Xu --- include/linux/huge_mm.h | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index de0c89105076..3bcdfc7e5d57 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -64,9 +64,6 @@ ssize_t single_hugepage_flag_show(struct kobject *kobj, 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<