Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2526144pxb; Thu, 3 Feb 2022 08:24:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJxExJHy7GMYfl9VODtf9m/r562Z6MOVYeHH+DKar2t+u7xVabXZIpGAxmVbhEW7dP1XhULU X-Received: by 2002:a17:907:2da0:: with SMTP id gt32mr28629154ejc.545.1643905475611; Thu, 03 Feb 2022 08:24:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643905475; cv=none; d=google.com; s=arc-20160816; b=dwRmFcuG8VWeV0piHeHiagE2zx6gvnqhhAP2l5C7jPDkHKYdbaVG0s52ZpTytqCwgF e7w6Jx7VgmF2bNTlUtjsQV6kbECaHWgtWtBeHPqpOHW+u3xNU+qO4qch1CuLJVQKMspE +NR0XRxB46McuIIpMe6V2tYxddLw6p9V6ZnP9cE48rjEfjxmX3bcw0E9IEzdJ0fte8Xw BoRYhrfGk2XojzuMf3xJ/BlinTzDaIi9YQbmIw7UfzS1tEODawc1nxrCvOJpo8enbzL9 qVYYgnAexx6lqj0grDZrM3WukDSp6dkLeuHPucUxIzv6dR2/y4ogJVxTK6w/D/7anHAg w6mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=RAyphi8GUVcsIw21fZnBuks9vuLeVomTTfPBNxbLeHY=; b=AfzyJBem/y3qjaW0cPHcq26W/CNLSp4QzC5bN4xp6y0eP6bNVlsmAcYhtBMFYfEYKd Fp47645rwBbv7Gaz3CFpG/3byQQ28toBjAFdn2LyuyUaxlQ2U2CXPTIJEJNe13fKHJiY 5lQoLqd68h9cN9T/We3F7gnbDszRrsYFBaXpqeEtGvHKRo/qKh+cnXH0IrkFinrbOEEQ JT3i43QEpUJ5widUG8QkIdUr6g44Z6amCjV63lPyoo42fYVT9UrurrTDQ4gHggZhS6OR MhoXYNyFOkM1mxwl9GVlpxLTLXSzhzSpkmXC2J/4gS9gkZBBkoTHeJ172TcMNI26+Mhd TIEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=lsfySTsN; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=QDph10v0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e12si13324997eds.545.2022.02.03.08.24.06; Thu, 03 Feb 2022 08:24:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=lsfySTsN; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=QDph10v0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351719AbiBCOfk (ORCPT + 99 others); Thu, 3 Feb 2022 09:35:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351332AbiBCOdn (ORCPT ); Thu, 3 Feb 2022 09:33:43 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CF5EC06173B; Thu, 3 Feb 2022 06:33:43 -0800 (PST) Date: Thu, 03 Feb 2022 14:33:40 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1643898822; h=from:from:sender:sender:reply-to: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=RAyphi8GUVcsIw21fZnBuks9vuLeVomTTfPBNxbLeHY=; b=lsfySTsNKJ8p1VQ2gTYq1rAYW1XMpR1SEct1f0XtYzvzPkZrjqLCqxNWVy4gZIQiHcvXAA t1N3rVYgRSOhwWh1D/AF5Baz85dn/+QOsjWbGi0715LcBzyTW4FYNkJvKrv/avLJ57XN3G qrADqSkdv3pJV788EOhwZOfSnSse8ey49++4AKHwWRwaz6IwiPc4K2biCs3CSmsCsIGSg1 7zwvBJoKKdWkdWHA1WH5Xynb1qFzc9vBqPX2NFgarcycEOIQLxZHTpEpgoq86Tl5qBKfnW 5gTsMfSLCE2E4TZIcC4scwUyBKbiR3diWUkL2Fp88fsIpOKG8JxAAt9QPuAxEg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1643898822; h=from:from:sender:sender:reply-to: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=RAyphi8GUVcsIw21fZnBuks9vuLeVomTTfPBNxbLeHY=; b=QDph10v0n/dixK6OMMBBR6gBN0pBTZiCvuyND3hITD58NFDx3H1pI/DiT16EDapNzRHCeG HKr/xoqUrlBm1ABw== From: "tip-bot2 for Zhen Ni" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched: move autogroup sysctls into its own file Cc: Zhen Ni , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20220128095025.8745-1-nizhen@uniontech.com> References: <20220128095025.8745-1-nizhen@uniontech.com> MIME-Version: 1.0 Message-ID: <164389882096.16921.11832456621387796894.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the sched/core branch of tip: Commit-ID: c8eaf6ac76f40f6c59fc7d056e2e08c4a57ea9c7 Gitweb: https://git.kernel.org/tip/c8eaf6ac76f40f6c59fc7d056e2e08c4a57ea9c7 Author: Zhen Ni AuthorDate: Fri, 28 Jan 2022 17:50:25 +08:00 Committer: Peter Zijlstra CommitterDate: Wed, 02 Feb 2022 13:11:37 +01:00 sched: move autogroup sysctls into its own file move autogroup sysctls to autogroup.c and use the new register_sysctl_init() to register the sysctl interface. Signed-off-by: Zhen Ni Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220128095025.8745-1-nizhen@uniontech.com --- include/linux/sched/sysctl.h | 4 ---- kernel/sched/autogroup.c | 23 +++++++++++++++++++++++ kernel/sched/autogroup.h | 1 + kernel/sysctl.c | 11 ----------- 4 files changed, 24 insertions(+), 15 deletions(-) diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h index c19dd5a..3f2b70f 100644 --- a/include/linux/sched/sysctl.h +++ b/include/linux/sched/sysctl.h @@ -45,10 +45,6 @@ extern unsigned int sysctl_sched_uclamp_util_min_rt_default; extern unsigned int sysctl_sched_cfs_bandwidth_slice; #endif -#ifdef CONFIG_SCHED_AUTOGROUP -extern unsigned int sysctl_sched_autogroup_enabled; -#endif - extern int sysctl_sched_rr_timeslice; extern int sched_rr_timeslice; diff --git a/kernel/sched/autogroup.c b/kernel/sched/autogroup.c index 8629b37..31dd259 100644 --- a/kernel/sched/autogroup.c +++ b/kernel/sched/autogroup.c @@ -9,6 +9,28 @@ unsigned int __read_mostly sysctl_sched_autogroup_enabled = 1; static struct autogroup autogroup_default; static atomic_t autogroup_seq_nr; +#ifdef CONFIG_SYSCTL +static struct ctl_table sched_autogroup_sysctls[] = { + { + .procname = "sched_autogroup_enabled", + .data = &sysctl_sched_autogroup_enabled, + .maxlen = sizeof(unsigned int), + .mode = 0644, + .proc_handler = proc_dointvec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 = SYSCTL_ONE, + }, + {} +}; + +static void __init sched_autogroup_sysctl_init(void) +{ + register_sysctl_init("kernel", sched_autogroup_sysctls); +} +#else +#define sched_autogroup_sysctl_init() do { } while (0) +#endif + void __init autogroup_init(struct task_struct *init_task) { autogroup_default.tg = &root_task_group; @@ -198,6 +220,7 @@ void sched_autogroup_exit(struct signal_struct *sig) static int __init setup_autogroup(char *str) { sysctl_sched_autogroup_enabled = 0; + sched_autogroup_sysctl_init(); return 1; } diff --git a/kernel/sched/autogroup.h b/kernel/sched/autogroup.h index b964199..90fcbfd 100644 --- a/kernel/sched/autogroup.h +++ b/kernel/sched/autogroup.h @@ -27,6 +27,7 @@ extern bool task_wants_autogroup(struct task_struct *p, struct task_group *tg); static inline struct task_group * autogroup_task_group(struct task_struct *p, struct task_group *tg) { + extern unsigned int sysctl_sched_autogroup_enabled; int enabled = READ_ONCE(sysctl_sched_autogroup_enabled); if (enabled && task_wants_autogroup(p, tg)) diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 5ae443b..1cb7ca6 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -1750,17 +1750,6 @@ static struct ctl_table kern_table[] = { .proc_handler = sysctl_sched_uclamp_handler, }, #endif -#ifdef CONFIG_SCHED_AUTOGROUP - { - .procname = "sched_autogroup_enabled", - .data = &sysctl_sched_autogroup_enabled, - .maxlen = sizeof(unsigned int), - .mode = 0644, - .proc_handler = proc_dointvec_minmax, - .extra1 = SYSCTL_ZERO, - .extra2 = SYSCTL_ONE, - }, -#endif #ifdef CONFIG_CFS_BANDWIDTH { .procname = "sched_cfs_bandwidth_slice_us",