Message ID | 20220302083758.32528-3-songmuchun@bytedance.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 32341C433EF for <linux-mm@archiver.kernel.org>; Wed, 2 Mar 2022 08:38:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C18CC8D0008; Wed, 2 Mar 2022 03:38:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BC76C8D0007; Wed, 2 Mar 2022 03:38:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AB7128D0008; Wed, 2 Mar 2022 03:38:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0109.hostedemail.com [216.40.44.109]) by kanga.kvack.org (Postfix) with ESMTP id 9D5A18D0007 for <linux-mm@kvack.org>; Wed, 2 Mar 2022 03:38:27 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 5B10B180927DB for <linux-mm@kvack.org>; Wed, 2 Mar 2022 08:38:27 +0000 (UTC) X-FDA: 79198794654.23.884A6EC Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by imf25.hostedemail.com (Postfix) with ESMTP id 3CCEBA0002 for <linux-mm@kvack.org>; Wed, 2 Mar 2022 08:38:28 +0000 (UTC) Received: by mail-pf1-f172.google.com with SMTP id u16so1265128pfg.12 for <linux-mm@kvack.org>; Wed, 02 Mar 2022 00:38:26 -0800 (PST) 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=6H6PLOlODlELuUrXrCLYoGeXhxxcGUB9kEy/fShHjn4=; b=kGOrPFJKIY2zeFcU6Bd2P7TZK+xqFiHSSY0aFvJaKv9cIpsG2U7WfOIWyPfgPKW0t1 7TG3A/OoFGobN9N1LfM1tkJ22xS2FqOVBkUry4O75X/IcXg6ZBFwiB1b4YG0RO2+jbkO SxB44nqufytorpbdgh3WgaY72Q/fMd3wXEsT5juGljg+xBvYwxny4kcaK+N50Ab60Y6t 8pOFo9uTJnX3LVpPKLbU33wZj3DhXV5+AaUAgbSZB7KWNjalg+E4EAMxk/wU/aQuE890 uoJRknbjxvl645OSqL8L8xPvmnsnn3QHd4eQ7mg83FiSwyN6zB5+5Sw+NNDrID0YVfCk zeLg== 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=6H6PLOlODlELuUrXrCLYoGeXhxxcGUB9kEy/fShHjn4=; b=S57OSoC/6Qm/7FzgI48jxnaIyn2Ap/zWe4yzQsTVOiZHqqI0GEQ6Tpz+j/Aq/brjOs 7d0jLqY+fJyUPqJndcDtA/NfiARsTYmaUhCmDMpGf23h6sgMAB6PZ9vPpRXbJrfCegXE rpC8nD+rWP1040yIkbmX2vceGGuDDcPbaGdrB/8uc8G9y/SqHOVkxBaXxJQ95QWn0xd+ I22Sw9ShEkG1rE0S9zMz7KS2eG+0gz5xKQt75BtSryiDLC9qBLn+MAbqvjN2w/qIRyKs ixlrbQ4TrAJiGnbTtPRuu59UfLjlyOtKpjgRCsxunGOpsQEwWMTtU0XRj2MZKqP9f5Dv r4mw== X-Gm-Message-State: AOAM532ihVCpzXxtZiMq//RfD2PLSD5roibsGvbDrgwoTx7RyHc3SXpn VfbfGUo/S0KzL1CrfZdLfg6ZIA== X-Google-Smtp-Source: ABdhPJzgdFgcCMX/hRjpvLUm5sqK8u+KnVSknTrF5zgAinrtJQ3utZbE65PdsaG5Q1sXGQgiS85mdg== X-Received: by 2002:a63:8ac2:0:b0:341:1e45:26c with SMTP id y185-20020a638ac2000000b003411e45026cmr25687808pgd.31.1646210306168; Wed, 02 Mar 2022 00:38:26 -0800 (PST) Received: from FVFYT0MHHV2J.bytedance.net ([61.120.150.70]) by smtp.gmail.com with ESMTPSA id 17-20020a056a00071100b004f0f941d1e8sm18705141pfl.24.2022.03.02.00.38.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 00:38:25 -0800 (PST) From: Muchun Song <songmuchun@bytedance.com> To: corbet@lwn.net, mike.kravetz@oracle.com, akpm@linux-foundation.org, mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, duanxiongchun@bytedance.com, smuchun@gmail.com, Muchun Song <songmuchun@bytedance.com> Subject: [PATCH v2 2/3] sysctl: allow to set extra1 to SYSCTL_ONE Date: Wed, 2 Mar 2022 16:37:57 +0800 Message-Id: <20220302083758.32528-3-songmuchun@bytedance.com> X-Mailer: git-send-email 2.32.0 (Apple Git-132) In-Reply-To: <20220302083758.32528-1-songmuchun@bytedance.com> References: <20220302083758.32528-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam10 X-Rspam-User: X-Stat-Signature: e85wuxgqs9pbzd88ni6xx1ebrzp7uqcm Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=kGOrPFJK; spf=pass (imf25.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.172 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Rspamd-Queue-Id: 3CCEBA0002 X-HE-Tag: 1646210308-659337 Content-Transfer-Encoding: quoted-printable 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: <linux-mm.kvack.org> |
Series |
add hugetlb_free_vmemmap sysctl
|
expand
|
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 64065abf361e..ab3e9c937268 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -1631,7 +1631,7 @@ int proc_do_static_key(struct ctl_table *table, int write, .data = &val, .maxlen = sizeof(val), .mode = table->mode, - .extra1 = SYSCTL_ZERO, + .extra1 = table->extra1 == SYSCTL_ONE ? SYSCTL_ONE : SYSCTL_ZERO, .extra2 = SYSCTL_ONE, };
Some sysctls only allow to be enabled and cannot be set back to be disabled. But proc_do_static_key() does not consider this situation, which set ->extra1 to SYSCTL_ZERO unconditionally. This patch add the ability to set ->extra1 to SYSCTL_ONE, which will be used in the next patch. Signed-off-by: Muchun Song <songmuchun@bytedance.com> --- kernel/sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)