Skip to content

Commit

Permalink
Merge pull request #10 from sched-ext/merge_latest
Browse files Browse the repository at this point in the history
v6.7.4-scx2
  • Loading branch information
Byte-Lab authored Feb 14, 2024
2 parents f81f7e2 + 73f4564 commit 28d15a6
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 = 7
SUBLEVEL = 4
EXTRAVERSION = -scx1
EXTRAVERSION = -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 @@ -3395,7 +3395,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 @@ -3633,23 +3640,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 @@ -3864,11 +3871,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 28d15a6

Please sign in to comment.