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 Apr 25, 2023
1 parent f14602b commit ae7c574
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
6 changes: 4 additions & 2 deletions Documentation/admin-guide/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,10 @@
Format: <int> (must be >=0)
Default: 64

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

bau= [X86_UV] Enable the BAU on SGI UV. The default
behavior is to disable the BAU (i.e. bau=0).
Format: { "0" | "1" }
Expand Down Expand Up @@ -3619,8 +3623,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.

nocache [ARM]

nodsp [SH] Disable hardware DSP at boot time.
Expand Down
12 changes: 12 additions & 0 deletions init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1293,6 +1293,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
9 changes: 6 additions & 3 deletions kernel/sched/autogroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
* Auto-group scheduling implementation:
*/

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 @@ -220,11 +221,13 @@ 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 ae7c574

Please sign in to comment.