Received: by 2002:a19:771d:0:0:0:0:0 with SMTP id s29csp1241119lfc; Wed, 1 Jun 2022 12:48:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBcWspUaIPLpuVYxk8uM72EzSAExFpCIyw/Yw4/axtabILB1oFzCINmaiGhTgka9VM1Ujw X-Received: by 2002:a65:62d0:0:b0:3fa:c6aa:6901 with SMTP id m16-20020a6562d0000000b003fac6aa6901mr863292pgv.314.1654112907846; Wed, 01 Jun 2022 12:48:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654112907; cv=none; d=google.com; s=arc-20160816; b=AHVu55i8lEMRfnfrhEHDhwY2wsD/QfcIeux7MEPZx+EwB4egBKle6uKYDK8qbGiN3o hBGjTmv9OBtxVRR7vIYzUFotYY3W1dRGhwlt5WoyqwvoZcewQqTP/oAZ3CjaIn2AdLHa 6FuS40gmtSNDUKED7x9FHKQGxt45wvQjxp4nl3u2m/ePX8cIh2DTg/OtFCfJFG61Spae AP9nFnNWlj+EeARtVm4Q8bplK7yx8ZxailtlOjw4fWaMj/soFDAoYKZLbR5FeLe1vi+x o+UM1+u14cl9mAaUFCxABPta6tvyjj3W6PrDcbx2q489ikV7iZKnO07ffOxI6vPfqbO2 HVig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=DS4blGTPG/TNOCJCMaY+3+JCDXOQcHN0U1VXQhbGGI4=; b=KnmgENC5TXD2dfECb6WytTVZslqUAsF1trhlFATYwF5vIL1Ji5MzGJnkAbOAiJXpGl +QdG+h4ucRRumU/e8+NrysbqQLsgJqMuaPgSZOmhhwV3FmxkqfeZWMJpPNQtbF1VyyRz HjQJkzeTAmNzOHGR/+Abrcnk7rCgEymzdU6E8KwFTuQgBszBjcxP1gm8dj8sVro8W91/ y3U1UpswCvIZToVg9GxY8Z6SsCkM3fSeh5VMFp8samvj2V0+NaN4qnlBu+Y8FlAQTbt8 Mjgz+2cCGfbd9cXz6TlYIHHq4czqxQlBe0xsO6rJEWyFlE4pzBt26Go59dNA00e9NToh qtAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OVW5GC3Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id q1-20020a170902b10100b00162464de994si3339963plr.119.2022.06.01.12.48.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 12:48:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OVW5GC3Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 56456BAD; Wed, 1 Jun 2022 12:11:42 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352354AbiFAKti (ORCPT + 99 others); Wed, 1 Jun 2022 06:49:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352359AbiFAKtg (ORCPT ); Wed, 1 Jun 2022 06:49:36 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6700C2E09E for ; Wed, 1 Jun 2022 03:49:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654080573; 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=DS4blGTPG/TNOCJCMaY+3+JCDXOQcHN0U1VXQhbGGI4=; b=OVW5GC3Q2fbman5xaKLPO1xCoh1UaDBTjmQKSuENQAIK3/dgxy80MzbyIXJJuzEwb2XFcI Se5r7k2VQaUOdwwpqYg2HE2g4E87kXrIW7x1YnLHFm64MRp08N/3GZNJrxNxx/gLzAYxs3 GGgRhbiMN4n70buN5qKUq9GNl5g8mhY= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-522-kMhGAKOSNNatawOqspwyyg-1; Wed, 01 Jun 2022 06:49:32 -0400 X-MC-Unique: kMhGAKOSNNatawOqspwyyg-1 Received: by mail-wm1-f69.google.com with SMTP id l34-20020a05600c1d2200b003973a50c1e4so944050wms.2 for ; Wed, 01 Jun 2022 03:49:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=DS4blGTPG/TNOCJCMaY+3+JCDXOQcHN0U1VXQhbGGI4=; b=NGbXexDfaxtOvDZu+DYM2EuOSs3SB6r6gK567cvQQU8UwBRrLznOdPJ73fMY9wbpV5 8hME+dIaaPzX3Fenz5A6tbvQys0BqHj1He/XZnHJwSGovvm3/Sx85dKo3SBg5xStvDBW rIziw+AMfZEmVKP+ULb4ChoG0jQRHKzpyOBLsW24OlM2ylw/kSqBj9xu6imWf8IycQZp A+s2L1Ju/JOBNLZCkXE/PXIVPh29CkZWEw4HgdWlIHu45AgdIBfYEK+HAKd48dRprn7P KPUzgUHQDpZyIlsgCJGIQQgpVDeCTLWdC0bAxLhjqQ2nlV27vcS87NfYUM3xpZ3oTLXH cRsA== X-Gm-Message-State: AOAM531jHiuRhpg/Dausv3OhOUY7VV0rF5OjQD/SEfWocklDoW/Xy5Tl x2Tz/aui5FDIdKCl+VSvphCW4mcqmOVu/qh5c4tvUqy2SlQpjt3zyCqD9r2KljPGkzuY5Po24gJ jL+0mrkt3RiNQealVCfVKJh5R X-Received: by 2002:adf:e10d:0:b0:20c:dc8f:e5a5 with SMTP id t13-20020adfe10d000000b0020cdc8fe5a5mr54387150wrz.265.1654080571197; Wed, 01 Jun 2022 03:49:31 -0700 (PDT) X-Received: by 2002:adf:e10d:0:b0:20c:dc8f:e5a5 with SMTP id t13-20020adfe10d000000b0020cdc8fe5a5mr54387131wrz.265.1654080570899; Wed, 01 Jun 2022 03:49:30 -0700 (PDT) Received: from ?IPV6:2003:cb:c705:2600:951d:63df:c091:3b45? (p200300cbc7052600951d63dfc0913b45.dip0.t-ipconnect.de. [2003:cb:c705:2600:951d:63df:c091:3b45]) by smtp.gmail.com with ESMTPSA id y18-20020a05600c365200b003942a244f54sm5775095wmq.45.2022.06.01.03.49.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Jun 2022 03:49:29 -0700 (PDT) Message-ID: <48a4a7f2-bee5-371a-1d9d-549fc59ce4f4@redhat.com> Date: Wed, 1 Jun 2022 12:49:28 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH 1/3] mm: hugetlb_vmemmap: cleanup hugetlb_vmemmap related functions Content-Language: en-US To: Muchun Song , mike.kravetz@oracle.com Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, smuchun@bytedance.com References: <20220404074652.68024-1-songmuchun@bytedance.com> <20220404074652.68024-2-songmuchun@bytedance.com> <087817e3-98ce-09f6-9ae9-68e544f43775@redhat.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, 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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>> #endif >>> #ifdef CONFIG_CGROUP_HUGETLB >>> /* cgroup control files */ >>> diff --git a/mm/hugetlb.c b/mm/hugetlb.c >>> index dd642cfc538b..1f9fbdddc86b 100644 >>> --- a/mm/hugetlb.c >>> +++ b/mm/hugetlb.c >>> @@ -1540,7 +1540,7 @@ static void __update_and_free_page(struct hstate *h, struct page *page) >>> if (hstate_is_gigantic(h) && !gigantic_page_runtime_supported()) >>> return; >>> >>> - if (alloc_huge_page_vmemmap(h, page)) { >>> + if (hugetlb_vmemmap_alloc(h, page)) { >>> spin_lock_irq(&hugetlb_lock); >>> /* >>> * If we cannot allocate vmemmap pages, just refuse to free the >>> @@ -1617,7 +1617,7 @@ static DECLARE_WORK(free_hpage_work, free_hpage_workfn); >>> >>> static inline void flush_free_hpage_work(struct hstate *h) >>> { >>> - if (free_vmemmap_pages_per_hpage(h)) >>> + if (hugetlb_optimize_vmemmap_pages(h)) >> >> It might be reasonable to call that hugetlb_should_optimize_vmemmap() >> then, letting it return a bool. >> > > How about the name of "hugetlb_vmemmap_optimizable()"? "should" seems to > tell the user that this hugetlb should be optimized, however, optimization > also depends on "hugetlb_free_vmemmap=on". "optimizable" seems to be more > appropriate, right? No strong opinion. Either is clearer to me compared to what we have right now :) -- Thanks, David / dhildenb