Skip to content

Commit

Permalink
Merge pull request #11 from sched-ext/merge_latest68
Browse files Browse the repository at this point in the history
v6.8-rc4-scx2
  • Loading branch information
Byte-Lab authored Feb 14, 2024
2 parents aaccc2a + 824f6e7 commit 4b8cae1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
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

0 comments on commit 4b8cae1

Please sign in to comment.