Skip to content

Commit

Permalink
XANMOD: sched/autogroup: Add kernel parameter and config option to en…
Browse files Browse the repository at this point in the history
…able/disable autogroup feature by default

Signed-off-by: Alexandre Frade <kernel@xanmod.org>
  • Loading branch information
xanmod committed Jun 28, 2021
1 parent 0d114ea commit 5c255f6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
6 changes: 4 additions & 2 deletions Documentation/admin-guide/kernel-parameters.txt
Expand Up @@ -356,6 +356,10 @@
autoconf= [IPV6]
See Documentation/networking/ipv6.rst.

autogroup= [KNL] Enable or disable scheduler automatic task group
creation.
Format: <bool>

show_lapic= [APIC,X86] Advanced Programmable Interrupt Controller
Limit apic dumping. The parameter defines the maximal
number of local apics being dumped. Also it is possible
Expand Down Expand Up @@ -3235,8 +3239,6 @@
noapic [SMP,APIC] Tells the kernel to not make use of any
IOAPICs that may be present in the system.

noautogroup Disable scheduler automatic task group creation.

nobats [PPC] Do not use BATs for mapping kernel lowmem
on "Classic" PPC cores.

Expand Down
12 changes: 12 additions & 0 deletions init/Kconfig
Expand Up @@ -1238,6 +1238,18 @@ config SCHED_AUTOGROUP
desktop applications. Task group autogeneration is currently based
upon task session.

config SCHED_AUTOGROUP_DEFAULT_ENABLED
bool "Enable automatic process group scheduling feature"
default y
depends on SCHED_AUTOGROUP
help
If set, automatic process group scheduling will be enabled per
default but can be disabled through passing autogroup=0 on the
kernel commandline during boot or a value of 0 via the file
proc/sys/kernel/sched_autogroup_enabled.

If unsure say Y.

config SYSFS_DEPRECATED
bool "Enable deprecated sysfs features to support old userspace tools"
depends on SYSFS
Expand Down
10 changes: 6 additions & 4 deletions kernel/sched/autogroup.c
Expand Up @@ -5,7 +5,8 @@
#include <linux/nospec.h>
#include "sched.h"

unsigned int __read_mostly sysctl_sched_autogroup_enabled = 1;
unsigned int __read_mostly sysctl_sched_autogroup_enabled =
IS_ENABLED(CONFIG_SCHED_AUTOGROUP_DEFAULT_ENABLED) ? 1 : 0;
static struct autogroup autogroup_default;
static atomic_t autogroup_seq_nr;

Expand Down Expand Up @@ -197,11 +198,12 @@ void sched_autogroup_exit(struct signal_struct *sig)

static int __init setup_autogroup(char *str)
{
sysctl_sched_autogroup_enabled = 0;

unsigned long enabled;
if (!kstrtoul(str, 0, &enabled))
sysctl_sched_autogroup_enabled = enabled ? 1 : 0;
return 1;
}
__setup("noautogroup", setup_autogroup);
__setup("autogroup=", setup_autogroup);

#ifdef CONFIG_PROC_FS

Expand Down

0 comments on commit 5c255f6

Please sign in to comment.