From patchwork Mon Jun 13 06:35:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12879055 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 49919C43334 for ; Mon, 13 Jun 2022 06:35:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C5B1E8D015C; Mon, 13 Jun 2022 02:35:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C09D48D0142; Mon, 13 Jun 2022 02:35:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AAB868D015C; Mon, 13 Jun 2022 02:35:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 9B3EE8D0142 for ; Mon, 13 Jun 2022 02:35:48 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 76CD720B79 for ; Mon, 13 Jun 2022 06:35:48 +0000 (UTC) X-FDA: 79572251976.20.6CC2483 Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by imf27.hostedemail.com (Postfix) with ESMTP id 1C01C4008B for ; Mon, 13 Jun 2022 06:35:47 +0000 (UTC) Received: by mail-pf1-f173.google.com with SMTP id c196so4938063pfb.1 for ; Sun, 12 Jun 2022 23:35:47 -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=J3yPX4pLteTBSSt3jyoxQC4mEw/61R+QtZm4AH/eCAw=; b=tFpKgo0j+PNLUDk0x391HcyJFSlH7ARGiFiArHFBqwwQvFstQSoTZFlD63itVTgYpc kUUVltfZZJyaBSPftr8vB5U60aL3+Bhhc3i9SxGcNDi/qPj+qPLIIzGOrxA0UqjRKOYe SJe68LscSGyRfpTbJWWulEAdjHzitTlvSq0Kgup9y7NhhFvjWFNRz49wAFlozK/qxWqV siEjOibdp+vbrc5CDd14o6Oxe7QSb5wHX6a2IUr2AzgcEZIY0IFOOHhtonhSWbQeg8bK JGZPFSeVlFm7Z22v9a5EJKJ3OIkN90hGOjnWYRJkdY5mztcGZsPWI8fuObj9As7/kq5u tDag== 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=J3yPX4pLteTBSSt3jyoxQC4mEw/61R+QtZm4AH/eCAw=; b=NWB+ZlV403VMcIysOF/mzX5H1+JNM5tMZcipG6j7JcxQhYBfKRBkEL5N067nHAErsM kmpHVVC2r+ugns3bljsUG6+pKdH6JGPFsbqfg37tSUrFfPH8w7Fj/YioIvsLWuEuZZOc //2DPacKTXElAeGVorgBWU0HV869IfkzZKm+u+Dezrzq1gtUhY4LledLVTaOf6YVdc1y mu95NipXyvpmGKsVAFEr1n/3MzL/CKavdNRYLNiBxzP04Ib/N2+MoMn4IzaWnz8leg99 LkkCH7CUJZ6bTnOJxvOtCq+LNeMibmLb8w1rIpo3DqHe/21ndK4YyGdbo8AEn2YOOI52 k6Zg== X-Gm-Message-State: AOAM531s9yjwZM4iPDdumVrGB1oNWJmeQNY8tCZlgZFM1DJWuyQvJiLk /+SdMSKKEznqU0kx8aTlCkgc7g== X-Google-Smtp-Source: ABdhPJy28P5B0qqGa3Ke6+SfMWEOc2cytKxdWdyOLSShHZNaM7W3nV99RcCZipyIALw6c+KciZ9G3w== X-Received: by 2002:a63:cf51:0:b0:408:85f4:fb33 with SMTP id b17-20020a63cf51000000b0040885f4fb33mr1973347pgj.589.1655102147198; Sun, 12 Jun 2022 23:35:47 -0700 (PDT) Received: from FVFYT0MHHV2J.bytedance.net ([139.177.225.255]) by smtp.gmail.com with ESMTPSA id v3-20020aa799c3000000b0051bc538baadsm4366554pfi.184.2022.06.12.23.35.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jun 2022 23:35:46 -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, Muchun Song Subject: [PATCH 5/6] mm: hugetlb_vmemmap: replace early_param() with core_param() Date: Mon, 13 Jun 2022 14:35:11 +0800 Message-Id: <20220613063512.17540-6-songmuchun@bytedance.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) In-Reply-To: <20220613063512.17540-1-songmuchun@bytedance.com> References: <20220613063512.17540-1-songmuchun@bytedance.com> MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655102148; a=rsa-sha256; cv=none; b=TNo4GtqVRraY2ty/z5HABrv20t/UhZ0/hAYbD+hkx9cIXW4weaXyXbS5364faHk0WGNTFc 4qTQ60RuiTxSJt8GC9D6LphOy5oMo8dA1L5OxCj3AVVrgOoSIYMS8kUebC4e2wxvwhKk8G 0NUfHqBGRxCEyzVUj7hhH99lJYssM1o= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=tFpKgo0j; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf27.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.173 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=1655102148; 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=J3yPX4pLteTBSSt3jyoxQC4mEw/61R+QtZm4AH/eCAw=; b=OTt3XGY0unNi2M89oZYxP+qWQJ0sxJos54yQBStKhzo/KfoP1ElbDZqNetI0ti3ZFZjkDv AGNEZRd2pCT6XZ+pDSLgEQEoFl7b2szzkpZJT8ArE9kNrQDXmkMar+2IEe1GFj4XXRlfzJ teebz2iF2SRgeJndvCe7QDTmNAZHbLQ= X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 1C01C4008B Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=tFpKgo0j; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf27.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.173 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Stat-Signature: e8qza5774uzzim9eqqhjqnifq5iy9hso X-HE-Tag: 1655102147-380013 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 and previous commit applied. 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 abdf441215bb..9808d32cdb9e 100644 --- a/mm/hugetlb_vmemmap.c +++ b/mm/hugetlb_vmemmap.c @@ -415,14 +415,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