Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp248545iog; Mon, 13 Jun 2022 01:37:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw83tAvlIYrfp05KLO5s1TGlABah42sKLYzrXegwRh23+7CqycY5WrZt42K3STHOF3okWb0 X-Received: by 2002:a17:906:6946:b0:70e:e904:8e87 with SMTP id c6-20020a170906694600b0070ee9048e87mr45250405ejs.629.1655109439670; Mon, 13 Jun 2022 01:37:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655109439; cv=none; d=google.com; s=arc-20160816; b=YRSmAuZAzxwezEXGoFcb32tco79gPF4qzrhltXc3dB62+kx0/lfRb3OUDazBnZYbno T2mJyiNHE87DZYD41kXCn0ev9Kmyby6tJincjlCbXb1EyP49h6lUVKOI79FyOvUXPF4i eMemoYxailZFnzQZdPonWSnz+rVu8piGxcYU2X3UV6Qm55qekcbZkcwUCaVmAo+pIrfA 9E9jysISpc1lPuFOH4xGr4eU1+zsVGA4TXIm3xYQY0dblAKTu46CMXpEx/yXq/Gc70SF 7mv/HWvnjJ9HaZammRFFsbeXBXIZXj5SrCUJDuBsCPZDu1uTFfwoc9tJI25F77cmKAhe HIGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+CJUH0/L+lNEkylRzdIbrkY/KTmlUTqUzOzvWe/voi8=; b=s0Yg8mcZyAs7mvJoej3eDoj8xhwgWo96xVP6zB5J0jMBGzwTwKf6DaRujvSGFwrYvK tBiMPkiE9RjEJCYn4cY80WdvZTslBKPcjTybazebn3rnnKr8PK1hYQ2syWvCskV8j77r cBOQyj7Y+ypvbcjf4tgcv0yDspVEmX6+gMM4NC2OUOxjJgyaul7Eq3FWW9fe8hunbAuT fBmT5tFj0YdMIxJgTEyFZx1EARjPFlp/eyI/JwcWguRICx8ga+revP8xLAx4sKG1v7Z5 W7o02QMSmHfY67wAow+7L0wt0KLG/s5a+yHdL/T7XKa5OthtspLVtpTDFeY2Lb7xIR3a 7Vag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=0YuVYFrl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js4-20020a17090797c400b007165339eb13si4232087ejc.624.2022.06.13.01.36.54; Mon, 13 Jun 2022 01:37:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=0YuVYFrl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239924AbiFMIYI (ORCPT + 99 others); Mon, 13 Jun 2022 04:24:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239902AbiFMIYG (ORCPT ); Mon, 13 Jun 2022 04:24:06 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 813E11A390 for ; Mon, 13 Jun 2022 01:24:05 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id u18so4505695plb.3 for ; Mon, 13 Jun 2022 01:24:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+CJUH0/L+lNEkylRzdIbrkY/KTmlUTqUzOzvWe/voi8=; b=0YuVYFrlpNbnZb+V6c9WFsLYKBkaCggjDhAq/i0UKLtkp/CAn4HdoX9/ExpzmdDBJw 7bhOVOmrg0nNabrn2NKesHAtq2BbmUXj7FrBN/uzP7mhZtNKDOZhknaqJvK167CLSLV0 mD4gzNeOxk3OIYsD9VeGRIKsMDJDmFedbSfzQbKD3m9T8VmX8r8O0YcNuicPQc1ajjyW D0Weae53u7bEp8dyzYreEC15/Eukj7VBA03XnopxiZD7ID30Hw5Lc27u+Kd/RBr+4Z11 SduTLXDH02tSKIb1LKAZ92aF9mdnLGThnswnLI2N/nlFjClt4q+/Fdi+pemWHk8H5reE IQQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+CJUH0/L+lNEkylRzdIbrkY/KTmlUTqUzOzvWe/voi8=; b=ly6mWK7FrBjAfiBRdpzfTCCz8bIHQjuHIuDHCKA5KG6j7JDeddU8R8QJlWIq0bzQFe exNsbxb9bbheJlVNQKrEKaGPI0pgCLlL2ZbIk0Ce/1MGCNsZCIpLmd9Us2EgVTIpRtvI mX/szkAWzMZnh0gCRQII2igTYZCrst1ra6qjMGRSUAB9L5RYnZGMrJSamAS3/jkjAPZR S9COISizd4jtQBBQm5/oGKkawLYRjb7N2BqnzfbPR2OCNJq9rPnYxNM8KhfTLN35bCoP 0UVRfMojEq0rGnq8mre61BJsMZoS8wCXx/DAS0aM6ijgg0ur43zuxUheavGZK+tsfHUm +7bw== X-Gm-Message-State: AOAM533+h3W/e/FbdUzD5hhFGLgE5DyuMUAUbaamnBkKmLhRcdaXUDlQ fyF8iOSMRsEZxNDDUDIHP0ljzQ== X-Received: by 2002:a17:90a:bc98:b0:1e8:6895:645e with SMTP id x24-20020a17090abc9800b001e86895645emr14764049pjr.131.1655108644994; Mon, 13 Jun 2022 01:24:04 -0700 (PDT) Received: from localhost ([139.177.225.255]) by smtp.gmail.com with ESMTPSA id q29-20020aa7843d000000b0051810d460adsm4648164pfn.114.2022.06.13.01.24.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jun 2022 01:24:04 -0700 (PDT) Date: Mon, 13 Jun 2022 16:24:01 +0800 From: Muchun Song To: Oscar Salvador Cc: mike.kravetz@oracle.com, david@redhat.com, akpm@linux-foundation.org, corbet@lwn.net, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH 2/6] mm: hugetlb_vmemmap: optimize vmemmap_optimize_mode handling Message-ID: References: <20220613063512.17540-1-songmuchun@bytedance.com> <20220613063512.17540-3-songmuchun@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 13, 2022 at 10:10:08AM +0200, Oscar Salvador wrote: > On Mon, Jun 13, 2022 at 02:35:08PM +0800, Muchun Song wrote: > > We hold an another reference to hugetlb_optimize_vmemmap_key when > > making vmemmap_optimize_mode on, because we use static_key to tell > > memory_hotplug that memory_hotplug.memmap_on_memory should be > > overridden. However, this rule has gone when we have introduced > > SECTION_CANNOT_OPTIMIZE_VMEMMAP. Therefore, we could simplify > > vmemmap_optimize_mode handling by not holding an another reference > > to hugetlb_optimize_vmemmap_key. > > > > Signed-off-by: Muchun Song > > LGTM, and it looks way nicer, so > > Reviewed-by: Oscar Salvador > Thanks for taking a look. > One question below though > > > -static enum vmemmap_optimize_mode vmemmap_optimize_mode = > > +static bool vmemmap_optimize_enabled = > > IS_ENABLED(CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON); > > So, by default vmemmap_optimize_enabled will be on if we have > CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON, but we can always override that > via cmdline, as below, right? > Totally right. CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON only control if the feature is enabled by default when the users do not specify "it should be off" via cmdline. Thanks.