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: 13599423 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 76183CD11BF for ; Thu, 21 Mar 2024 22:09:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wpMuRMt9G6xgUcSFaesMCOY7EgWGKvVnTuWZNKK/13w=; b=ZXDWNi8bfHJ7iA B8sznlqNCmx6dhud0+gaj/IV83l/HUzuFYXhn3KJdREb2NGJ+1qxT/KgNAWgYGGPALbzlj2o/J2UA 51CQlCqWiyh9XcG9bNaKu42kACko/jNeAx9cTdMtTbh3ex0z3hdPgtv2/VqyVm4Qw7k7iZCV81VVh A9xDIUpYYYvqZGxdQp7evT5GikGSY9S6ozNh3kKKcnu2auv0nc5drhEfY2C/cpaqw/w/4V5aQpxwv H41aJS8mdgWAPKRbZGIpjOu7y7WVY94QLDd2ePMTx3WKSu81cS2tXqOwVvI8yOJOm9Lu0daosPM06 hpP+hxqN1uC6FKwNd4EA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnQaf-00000004qnL-3YOp; Thu, 21 Mar 2024 22:08:49 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnQa6-00000004qHZ-1TNp for linux-arm-kernel@lists.infradead.org; Thu, 21 Mar 2024 22:08:16 +0000 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-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-114-yGbm1zZ8PEKRKGHGZvknqQ-1; Thu, 21 Mar 2024 18:08:11 -0400 X-MC-Unique: yGbm1zZ8PEKRKGHGZvknqQ-1 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-430b4572a97so4829091cf.1 for ; Thu, 21 Mar 2024 15:08:11 -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=Vxm9QXoww6gtXSy7UHGbHSO25DUsirj7Ni/ORNU5t8osHErCOp7lcjITPaJwzYQM4e EJTMVqllbUALFSe5X5EbIp3r3frdp+0tbYiblfcOTYLoGVLFbc+WfF7bCIKk4MglgWiM s82OoacJ8cgAlyIxCz/qL7XbVw/vzIcHNvtcGX5IgLa4GzyFbKlOToUKQcs3BON2pdVd kUroX6/dZ+UvmzVxP2C8irfQ2s8IKH9ErDhhcOXBk37XsLuaNQo8frPtqu+FEIQM2WoV 0D+aGMEygoGIkAv7Cll6scPouJ4ccC0SR5nkl3i/mo/1JYlbUDmi8M7BJwVGBisnIXMO Kk9g== X-Forwarded-Encrypted: i=1; AJvYcCVdOPNP3FsXrNaVxeDoCX/4ncZKYdqSkaR3gwALf1C+cDcii+/D7CZj9GA6ftCDJ3T/bAbyfogYLL64/jennuZSIVYg4ZGLvsbe83xYdz+yBJgdJQU= X-Gm-Message-State: AOJu0YwPt2e79wOiINh90A4eUf8s+AKhnUFl8wLIL5cHjcnLlVnql1tx PcU8lm17YajHeFhHTqVFYg9o+2e40EMxf9MdBnuzZPUT+VA+YQggmtE3TNbxO9hxuYA2sg3ulpz Gw58Da+6DkPcvQIBLyp/XBrXZfr6oRLYD+Sc6Kf6en4+fl3Mb3FOH3rdGoQNSWEJFfH7Yt4h2 X-Received: by 2002:a05:6214:3a8a:b0:690:3c85:c5b with SMTP id nz10-20020a0562143a8a00b006903c850c5bmr195569qvb.3.1711058891367; 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240321_150814_638899_532E86AE X-CRM114-Status: GOOD ( 13.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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<