Message ID | 20220323125523.79254-4-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 023B6C433EF for <linux-mm@archiver.kernel.org>; Wed, 23 Mar 2022 12:57:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 834696B0075; Wed, 23 Mar 2022 08:57:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7E2CB6B0078; Wed, 23 Mar 2022 08:57:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6AB4A8D0001; Wed, 23 Mar 2022 08:57:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0027.hostedemail.com [216.40.44.27]) by kanga.kvack.org (Postfix) with ESMTP id 5C6496B0075 for <linux-mm@kvack.org>; Wed, 23 Mar 2022 08:57:35 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 14BBBA325A for <linux-mm@kvack.org>; Wed, 23 Mar 2022 12:57:35 +0000 (UTC) X-FDA: 79275652470.30.0FD9C10 Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) by imf17.hostedemail.com (Postfix) with ESMTP id A9B8940027 for <linux-mm@kvack.org>; Wed, 23 Mar 2022 12:57:34 +0000 (UTC) Received: by mail-pg1-f174.google.com with SMTP id s72so1049880pgc.5 for <linux-mm@kvack.org>; Wed, 23 Mar 2022 05:57:34 -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=VeiakI6ZdfDqy26wAEKtPtiKSfYNO4Hqsr8Ua8hMV6s=; b=zeeWwcCD9//7csZdk9BkAb8ksK2GIgn57HPaFohCWXiiP8aYQSHKB2Hpfdb13YuOEX KIJ4aNjZW7yk8vagCxd46XF6rNCQ7YkPfMZ97gOgF2rlWWD8XKvcBGg0RSxWP7JyZUWY DFzfyXxLUFe3c+70ocA8kagHeHwgeIA5WneZCToDLSzWhq9fjq5q+/1YPv/4n/HHs5Fn Yx7FUpK7u7Y8o+TsJ0QitplE3fSmqJ1rqiYwmoCSHOy3wpsTfpbXUWeOvHBIArgLk837 BZUvNuawJx/tk5w8zW96S7+aT3Ubv3REKDr6/izxMpR6qsjkj9OdlhRloavP8QytBtii ZsHQ== 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=VeiakI6ZdfDqy26wAEKtPtiKSfYNO4Hqsr8Ua8hMV6s=; b=qzme9NlGD+YtNnccrA+bNigHuDQO1kCzEN7f8hhnYl2HRZedVQN6bopR+Tt+PwT2/b ON/3z1/8/AH03kfN/v3dyxuhUoBI5EWuP9gYNxxw6YuPQKOGwAXaHVTPnjqtHFG3jHRR VxLyPIeB5ugwdcoKKnne5jfH9KVSvE8uFsoM7NFlQpLrIRlegbU9zLjynHyPe0ThLGTS 0ApEHY52MMMqEChkTrz3oRXfi9YZYxyteGZWOGJG5pAKQyrmt9tb1s7NN62klLjb0ksW 5LktYW4CkNMFd3pfcnmBywKweNCMnLmNNLeu8yxZKFJHATotCl4/ft0Vm4Mct4gwRynx H3JA== X-Gm-Message-State: AOAM530avvnW1inmvDlXDr+Cor/WkF8kb5j2oBUU7ujFvm7oYJQavT9/ ah512dEw7FYSNRjaWwVwgYC+rRxbJxMAgw== X-Google-Smtp-Source: ABdhPJzfb3QxTbZHF2sE8H1JPQSnUAsBsuCcE1dCXSiB41/ce3nustfqBUnhgXYLIVEMuV9Ic1mN6A== X-Received: by 2002:a63:475c:0:b0:381:ef1e:7099 with SMTP id w28-20020a63475c000000b00381ef1e7099mr25853767pgk.225.1648040253862; Wed, 23 Mar 2022 05:57:33 -0700 (PDT) Received: from FVFYT0MHHV2J.bytedance.net ([139.177.225.238]) by smtp.gmail.com with ESMTPSA id k185-20020a6384c2000000b003821dcd9020sm15716517pgd.27.2022.03.23.05.57.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Mar 2022 05:57:33 -0700 (PDT) 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, osalvador@suse.de, david@redhat.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 v5 3/4] sysctl: allow to set extra1 to SYSCTL_ONE Date: Wed, 23 Mar 2022 20:55:22 +0800 Message-Id: <20220323125523.79254-4-songmuchun@bytedance.com> X-Mailer: git-send-email 2.32.0 (Apple Git-132) In-Reply-To: <20220323125523.79254-1-songmuchun@bytedance.com> References: <20220323125523.79254-1-songmuchun@bytedance.com> MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: A9B8940027 X-Stat-Signature: g47o8mubdzrz1i86f97txuyadj8m4h3d Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=zeeWwcCD; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf17.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.215.174 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Rspam-User: X-HE-Tag: 1648040254-71101 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 770d5f7c7ae4..1e89c3e428ad 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -1638,7 +1638,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, };
proc_do_static_key() does not consider the situation where a sysctl is only allowed to be enabled and cannot be disabled under certain circumstances since it set "->extra1" to SYSCTL_ZERO unconditionally. This patch add the functionality to set "->extra1" accordingly. Signed-off-by: Muchun Song <songmuchun@bytedance.com> --- kernel/sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)