Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp341874rdh; Mon, 18 Dec 2023 23:57:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHhob/1LQxev2LJjaiZ6iLWgxIyB+vYuYIUnAF+vfUqlN9Wsj1OVkDky2m2/mwRFYBiuzip X-Received: by 2002:a05:622a:118b:b0:423:a3c9:8e7c with SMTP id m11-20020a05622a118b00b00423a3c98e7cmr22330559qtk.48.1702972629351; Mon, 18 Dec 2023 23:57:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702972629; cv=none; d=google.com; s=arc-20160816; b=XdyPt/XdnUGg/aCFHxDyeG1IolMZI2hDaMk2RSO+06zLB+fZn2RnLxNz1+vbL6J5t1 ox2LlnJJ73h6GYXkUdrnNAtMvQQ+0zwhxxBzMUp9SGhCNm9nO/KA8pF2kwIWQkmgfrC4 2RygNWlhQAUHx3NwfvDluLCvLpf8oSad3glPUHvJrPwZ0pvSdWoFa4rNNWccJ+YEFVi6 s9tSc7nSLHFg2CNQxV+BsfM1oA1EtVFvxW+H7IJ2HJWZkGkMF9H5GBEEbw7Vjc2XZICC zM/FTCPayn634MIEVGVQq7jMr6ijCZxBXrkLBP2cHeg7AhK0atzDPOqUug/tORVwtd11 +CIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=W3mfDaRytJv6LOYv89LHjQVs33fumKlGjLMhNR5CFmw=; fh=3mpu6Yyr5hMzDKtkQvzcApl7ZSQGU4G8QyIY2BAU7VY=; b=out1xCweo97M2znSw4vfEA+8JLKGdsG93l3KW7oh0OaPDcm4tMYPaYR/QKZj5r7IzO fZQdsHeB94fCzVBsyCOHO8ae/LeP9owkgJex4Ezomn/PNrsZs8xNZqJinW6ms/grMLVj 40AdzlMHcY2vZve2CQTFm/F4C6uJfh1YGcono/7EdxOd8RNZqpqoH1OJ4rYkT9+7N1Ak PydwPiOmD/saKO2UR/o3h8UiM7WWtjpbf70OVH9sSypzYsb3OEN8JeEQL9nHnV9hcfTg U8uKS/gI2vdkiQ1u3JMaCTFavKfITDWLxT8OyVdBuA9P1AqEurk7uZee4dqAiRIUIwh2 rz8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="TwZnA+/P"; spf=pass (google.com: domain of linux-kernel+bounces-4837-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4837-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id z17-20020a05622a029100b00423b3c0a8c2si26614501qtw.581.2023.12.18.23.57.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 23:57:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4837-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="TwZnA+/P"; spf=pass (google.com: domain of linux-kernel+bounces-4837-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4837-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0E0441C2389F for ; Tue, 19 Dec 2023 07:57:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 00945156D2; Tue, 19 Dec 2023 07:56:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="TwZnA+/P" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 B37EA154A2 for ; Tue, 19 Dec 2023 07:56:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702972608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=W3mfDaRytJv6LOYv89LHjQVs33fumKlGjLMhNR5CFmw=; b=TwZnA+/POS/8p5MX8b8NuTCJRqef+OuEAkm9Sk73SpR4gW4vspKqYa5kSMsZg7kIUWYIyf hChUrNjx6t0+VlEO/xlvuGvZM/HfzC+F0bXtCcVfxyO/yYb9gIeogwfxGKhpzlP3kjfd0C 1T5eRdIREvZQhjDxnzzBz0ca8pmgQFc= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-296-k0rHzqs9O9yPkXz_rzqp7g-1; Tue, 19 Dec 2023 02:56:41 -0500 X-MC-Unique: k0rHzqs9O9yPkXz_rzqp7g-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0C34B1C0513F; Tue, 19 Dec 2023 07:56:40 +0000 (UTC) Received: from x1n.redhat.com (unknown [10.72.116.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id E06102026D66; Tue, 19 Dec 2023 07:56:28 +0000 (UTC) From: peterx@redhat.com To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Matthew Wilcox , Christophe Leroy , Lorenzo Stoakes , David Hildenbrand , Vlastimil Babka , Mike Kravetz , Mike Rapoport , Christoph Hellwig , John Hubbard , Andrew Jones , linux-arm-kernel@lists.infradead.org, Michael Ellerman , "Kirill A . Shutemov" , linuxppc-dev@lists.ozlabs.org, Rik van Riel , linux-riscv@lists.infradead.org, Yang Shi , James Houghton , "Aneesh Kumar K . V" , Andrew Morton , Jason Gunthorpe , Andrea Arcangeli , peterx@redhat.com, Axel Rasmussen Subject: [PATCH 04/13] mm: Make HPAGE_PXD_* macros even if !THP Date: Tue, 19 Dec 2023 15:55:29 +0800 Message-ID: <20231219075538.414708-5-peterx@redhat.com> In-Reply-To: <20231219075538.414708-1-peterx@redhat.com> References: <20231219075538.414708-1-peterx@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 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 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 fa7a38a30fc6..d335130e145f 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<