From patchwork Tue Jun 28 09:22:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12897953 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EEE77C43334 for ; Tue, 28 Jun 2022 09:24:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 91FF68E0009; Tue, 28 Jun 2022 05:24:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8A8348E0001; Tue, 28 Jun 2022 05:24:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 723A98E0009; Tue, 28 Jun 2022 05:24:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 5DA068E0001 for ; Tue, 28 Jun 2022 05:24:12 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 3A67F8059D for ; Tue, 28 Jun 2022 09:24:12 +0000 (UTC) X-FDA: 79627108344.19.FB3782E Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by imf07.hostedemail.com (Postfix) with ESMTP id E164140011 for ; Tue, 28 Jun 2022 09:24:11 +0000 (UTC) Received: by mail-pf1-f174.google.com with SMTP id d17so11448149pfq.9 for ; Tue, 28 Jun 2022 02:24:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tKsl/FyBMuyoLwv1dbdkul0HUkyTRTbta9GTd/qg648=; b=kmlXP3rmTBXz5+4TJo//hmT2jB4MxmfWPs8iGQkHOlQBg+rsoPITThmujE5oZlqSyG fWu7CtFdyuxFIJPn+ajdlR9dCr4S51oy4WvnwewRQZdfq7E+j0mQSwzwRjSgIvguexqG fk3Qt+5y38+wp9WNkk+LMSBP0nc8nXemI+xT/4laLfvG8cccB66V1pbT2qVRKK9w1/7z UOZnxF6q0kGOYIWB/RFeprJs1fGdcR+PEaOaKE3JNBOyceQycTM2BgCSUGxmZLe99u1C xX95JGCPjlHlauI6BtduVriW4yYgE9uvq9xJq+thJNgUvkPEcXuFCutJkJYjKCnMEGKi LBKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tKsl/FyBMuyoLwv1dbdkul0HUkyTRTbta9GTd/qg648=; b=kxB+s79kQ+S+uDM8tacuwmluX+labJ4Xoy8SjxxymiRq+eBm7KJBGvfKqhuJjc/Oo/ 98Xt2BDoxg8aPYR46kFohlv7/E1jyGR6/5VQafe9WXOt6aamv5z67d1j5Z1hy8TzdthZ epkklB67fL4ETSMWkZ4O3s+qJxj3ui1BXmEjOwDX8FFsyo+Ww0VX0cI11LgbMUzuhkYV cvl8nv9ebfHu1SXFOTKmRmACW+kDbek8gUBrUIattiTweHDZaXSkxKZOyQ6UtVDGt07a 9fFA2Dv02T2X7QdSvt5HF7x1/MH4I4WmodJyCapzNoMvU931dGr9qGyr5Yo5IuV2a2am 5pUA== X-Gm-Message-State: AJIora+OM+WWDKCeFO9eY/Nn6hHAJHZpeBGukCo3bnK1VrgMFVQQBAQt mtJPmIvSeCGcZtmRTxqn14X5Fw== X-Google-Smtp-Source: AGRyM1tM8i7pH8lTHkass0ZEXT2Z2SMP+f0quLdvC0M1TlAQly/dZen+wWI1RJzBbMXck8L6xsm+yg== X-Received: by 2002:a63:a748:0:b0:40c:9a36:ff9a with SMTP id w8-20020a63a748000000b0040c9a36ff9amr16326337pgo.545.1656408251045; Tue, 28 Jun 2022 02:24:11 -0700 (PDT) Received: from FVFYT0MHHV2J.bytedance.net ([139.177.225.245]) by smtp.gmail.com with ESMTPSA id mm9-20020a17090b358900b001ec729d4f08sm8780463pjb.54.2022.06.28.02.24.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jun 2022 02:24:10 -0700 (PDT) From: Muchun Song To: mike.kravetz@oracle.com, david@redhat.com, akpm@linux-foundation.org, corbet@lwn.net Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, duanxiongchun@bytedance.com, Muchun Song Subject: [PATCH v2 5/8] mm: hugetlb_vmemmap: replace early_param() with core_param() Date: Tue, 28 Jun 2022 17:22:32 +0800 Message-Id: <20220628092235.91270-6-songmuchun@bytedance.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) In-Reply-To: <20220628092235.91270-1-songmuchun@bytedance.com> References: <20220628092235.91270-1-songmuchun@bytedance.com> MIME-Version: 1.0 ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=kmlXP3rm; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf07.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.174 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656408251; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=tKsl/FyBMuyoLwv1dbdkul0HUkyTRTbta9GTd/qg648=; b=SvKM47625BIhMUJVjFVTRmWhkUwWooLC+6BmKMFn1G3fAYqo0n/fqXBDLriKylzfyEA5jE i2qr2k81tiVtNe+BgOMzFNhXpNgwbueKjTVJY0+HwyERpugn6pOY04w+DasOD1jJJsQxAV 4IDsizwH9251dJ0O1DhoEvBEkEXBxn0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656408251; a=rsa-sha256; cv=none; b=PBcLN46tHjVAYD2Q5oB5sPUjIMN4OcuF5BWAv7TEVakqF3paihe3kAm92EfolfK9zVwyYX 9R3kOG1RvAKQ3m1mbqCWuOT0UrjJm/EzXBd5D2708bhFazkzu9CF+7rQOXtoFpObLPSKyv tH/C6mrsOiV7M0OeUEYX/ywFrAQ0s8c= X-Stat-Signature: yhai9sxzwy7wxwrfsbjyxbp6j9cc8xz6 X-Rspamd-Queue-Id: E164140011 Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=kmlXP3rm; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf07.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.174 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1656408251-9668 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: After the following commit: 78f39084b41d ("mm: hugetlb_vmemmap: add hugetlb_optimize_vmemmap sysctl") There is no order requirement between the parameter of "hugetlb_free_vmemmap" and "hugepages" since we have removed the check of whether HVO is enabled from hugetlb_vmemmap_init(). Therefore we can safely replace early_param() with core_param() to simplify the code. Signed-off-by: Muchun Song Reviewed-by: Mike Kravetz --- mm/hugetlb_vmemmap.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/mm/hugetlb_vmemmap.c b/mm/hugetlb_vmemmap.c index 4d404d10c682..b55be6d93f92 100644 --- a/mm/hugetlb_vmemmap.c +++ b/mm/hugetlb_vmemmap.c @@ -423,14 +423,8 @@ static int vmemmap_remap_alloc(unsigned long start, unsigned long end, DEFINE_STATIC_KEY_FALSE(hugetlb_optimize_vmemmap_key); EXPORT_SYMBOL(hugetlb_optimize_vmemmap_key); -static bool vmemmap_optimize_enabled = - IS_ENABLED(CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON); - -static int __init hugetlb_vmemmap_early_param(char *buf) -{ - return kstrtobool(buf, &vmemmap_optimize_enabled); -} -early_param("hugetlb_free_vmemmap", hugetlb_vmemmap_early_param); +static bool vmemmap_optimize_enabled = IS_ENABLED(CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON); +core_param(hugetlb_free_vmemmap, vmemmap_optimize_enabled, bool, 0); /* * Previously discarded vmemmap pages will be allocated and remapping