Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v6.8-rc4-scx2 #11

Merged
merged 4 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
VERSION = 6
PATCHLEVEL = 8
SUBLEVEL = 0
EXTRAVERSION = -rc4-scx1
EXTRAVERSION = -rc4-scx2
NAME = Hurr durr I'ma ninja sloth

# *DOCUMENTATION*
Expand Down
29 changes: 18 additions & 11 deletions kernel/sched/ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -3400,7 +3400,14 @@ static void scx_ops_disable_workfn(struct kthread_work *work)
SCX_CALL_OP(SCX_KF_UNLOCKED, exit, ei);

cancel_delayed_work_sync(&scx_watchdog_work);
/*
* Delete the kobject from the hierarchy eagerly in addition to just
* dropping a reference. Otherwise, if the object is deleted
* asynchronously, sysfs could observe an object of the same name still
* in the hierarchy when another scheduler is loaded.
*/
kobject_del(scx_root_kobj);
kobject_put(scx_root_kobj);
scx_root_kobj = NULL;

memset(&scx_ops, 0, sizeof(scx_ops));
Expand Down Expand Up @@ -3638,23 +3645,23 @@ static int scx_ops_enable(struct sched_ext_ops *ops)
goto err_unlock;
}

scx_exit_info = alloc_exit_info();
if (!scx_exit_info) {
ret = -ENOMEM;
goto err;
}

scx_root_kobj = kzalloc(sizeof(*scx_root_kobj), GFP_KERNEL);
if (!scx_root_kobj) {
ret = -ENOMEM;
goto err;
goto err_unlock;
}

scx_root_kobj->kset = scx_kset;
ret = kobject_init_and_add(scx_root_kobj, &scx_ktype, NULL, "root");
if (ret < 0)
goto err;

scx_exit_info = alloc_exit_info();
if (!scx_exit_info) {
ret = -ENOMEM;
goto err_del;
}

/*
* Set scx_ops, transition to PREPPING and clear exit info to arm the
* disable path. Failure triggers full disabling from here on.
Expand Down Expand Up @@ -3869,11 +3876,11 @@ static int scx_ops_enable(struct sched_ext_ops *ops)

return 0;

err_del:
kobject_del(scx_root_kobj);
err:
if (scx_root_kobj) {
kfree(scx_root_kobj);
scx_root_kobj = NULL;
}
kobject_put(scx_root_kobj);
scx_root_kobj = NULL;
if (scx_exit_info) {
free_exit_info(scx_exit_info);
scx_exit_info = NULL;
Expand Down