Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2985200rdb; Wed, 15 Nov 2023 17:30:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IFKi+l6IdqVWntMhlhkqRjuD5Tcc8QfRt2lHbY3klxA6wSCo/s9TUGzXWTaFNOQt/aD+d9X X-Received: by 2002:a17:90b:3012:b0:280:25b8:ae8f with SMTP id hg18-20020a17090b301200b0028025b8ae8fmr12798595pjb.37.1700098247756; Wed, 15 Nov 2023 17:30:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700098247; cv=none; d=google.com; s=arc-20160816; b=CJZmYmYjD1c607tp+lkp5EVZ9XllihYIbCu0hvxG5JD4oMUWJN3LJr60sFQavt1WvP Q8Jcf3GJg1VyaDnzFfPn1I7t86Tb59sj0NVexRClaN2p0Ax1DaUOj07s8XcRIbr2Zpgi /U4BlIpif8pVlbkTzP0zq8jr6nVFzyAI8EVQZIrLJUMZ2Z4JPf+n5V19FOlEszQ3adcN qbLx8z94B2bChW3Q0HR+i2PTFVPS2AdlMlQL4Wsj1S84RtMjXk2ayWZYDMkonZZ2M/vL uIciQdqWKstENpjsU2tzqqnxs92bSqpXenty+4ENugWCHG+EMfeCuZqoP8zlb7n+EDp5 7pRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PGiD5LrOPbNAVIZVL9CsLOYGNogun3F0ZNXBV5lOZSk=; fh=o+FJD7UTEFgAOwGBZppViFyhRpBzPGRfoO/6xzRNnMs=; b=cUYo+BGJgElN84MOF2ZA52CjikIZ+0Q9aRpbG7fke7N+s+luZvhQ5buqdYjjByQydd jyVD7YQ66B9/P21RBz8Vw8Pu1CUCNPgx1Zwg5AjO+mYmAFRZNz+//HlSth1HNupVGHU/ Wyg//bGmo2mD6dfoemsS/7ib4Ng1Xp6IGhyxK5qtyTxHhWh4fMG7vTltbRNRCtphbVKL +izJEdKnuuWLU8dkcXWyxm5DbSY8s3ahJOoXXpJv0PbAxq6eopH3XxlIhUirjM2omaEj Gr91IQX9oiyEBbVBQFTYAjtJQ0WHfWtOA874+J3BuRShmmQ5V6bUw1aJuycQ1JOc8P8q FlQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LgKVGdB6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id t15-20020a17090b018f00b0028016799242si890400pjs.80.2023.11.15.17.30.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 17:30:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LgKVGdB6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id CF6EE80286BC; Wed, 15 Nov 2023 17:29:59 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344474AbjKPB33 (ORCPT + 99 others); Wed, 15 Nov 2023 20:29:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344326AbjKPB3Y (ORCPT ); Wed, 15 Nov 2023 20:29:24 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4538419B for ; Wed, 15 Nov 2023 17:29:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700098160; 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=PGiD5LrOPbNAVIZVL9CsLOYGNogun3F0ZNXBV5lOZSk=; b=LgKVGdB6I4hNe4lwEdpQGH/NWKuJhQm4TWd80F/drBP9Vq8+DJCrNjCFv/e2kuYEzj5+7d e3ZI6JJ9s8w+mluRgz+vQmVYzjLiY7p4QY+g3zRawMDOY2z+hgurdBfHgiSJViKCvNQYr6 S95Aih6Eb2bBC33DMba37QwRgM6LpgQ= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-633-w0VJCoTSNWCS79fGDUeRTw-1; Wed, 15 Nov 2023 20:29:17 -0500 X-MC-Unique: w0VJCoTSNWCS79fGDUeRTw-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-66ffa15d354so814626d6.0 for ; Wed, 15 Nov 2023 17:29:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700098156; x=1700702956; 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=PGiD5LrOPbNAVIZVL9CsLOYGNogun3F0ZNXBV5lOZSk=; b=FJ8tWTHSk7IrYTtgVBxiuvJsBDwI9TAywTI9/KP81JFBMTD004U5/1PrtccqxC+Xkh IVwp9SRsLDKoD9ebHCG86graWF20A7ICcwfb3WEDaTLxNssqoQkr/vJOjGp3/fwubx+I Y0G0nJrmWrh/btWLcDrqxzGz7SCBh4YkJOBqwqbwvXYSBHQYajKPfs/31UOE1aY9AkxD CcTSYYjYqsmCWsknGO2rhtyTdan/VvVAxLq2SoCn9QqnFbyhFAYPSJCtyzQRYwLw5K+0 +WHpYhpqluAv6RQzV/tz0exP1bU+nGIrym8RIr9Tb3gAcOhWQWjoJzv8clJkmmHvyqe2 JAHw== X-Gm-Message-State: AOJu0Yx9GOtu0iC3/zK1za/xuyk4dpw1sTCc/EyS5n5pNgP9Od8BQ9R7 LVheTEt/84XV1vrY/26q7ORNrZ35BpDcpbIgxg9AszZGCRRsVmh4yB1v3agZ+rvVttMinK+Nqsl iNnh2E5gSwNI5u/By5Mj9jQOT5RNnvxqc/5UTqCqpLyeND4xEy9d+7pvDcOQh3cGvqqRwcIeMYB LZsw38+A== X-Received: by 2002:a05:622a:8008:b0:41e:a62b:3d28 with SMTP id jr8-20020a05622a800800b0041ea62b3d28mr6714107qtb.4.1700098156347; Wed, 15 Nov 2023 17:29:16 -0800 (PST) X-Received: by 2002:a05:622a:8008:b0:41e:a62b:3d28 with SMTP id jr8-20020a05622a800800b0041ea62b3d28mr6714076qtb.4.1700098155869; Wed, 15 Nov 2023 17:29:15 -0800 (PST) Received: from x1n.redhat.com (cpe5c7695f3aee0-cm5c7695f3aede.cpe.net.cable.rogers.com. [99.254.144.39]) by smtp.gmail.com with ESMTPSA id c24-20020ac85198000000b0041e383d527esm3922598qtn.66.2023.11.15.17.29.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 17:29:15 -0800 (PST) From: Peter Xu To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Mike Kravetz , "Kirill A . Shutemov" , Lorenzo Stoakes , Axel Rasmussen , Matthew Wilcox , John Hubbard , Mike Rapoport , peterx@redhat.com, Hugh Dickins , David Hildenbrand , Andrea Arcangeli , Rik van Riel , James Houghton , Yang Shi , Jason Gunthorpe , Vlastimil Babka , Andrew Morton Subject: [PATCH RFC 03/12] mm: Export HPAGE_PXD_* macros even if !THP Date: Wed, 15 Nov 2023 20:28:59 -0500 Message-ID: <20231116012908.392077-4-peterx@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231116012908.392077-1-peterx@redhat.com> References: <20231116012908.392077-1-peterx@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 15 Nov 2023 17:30:00 -0800 (PST) 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. 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 fa0350b0812a..ec463410aecc 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -64,17 +64,19 @@ 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<