Skip to content

Commit

Permalink
sched: generate uevents for user creation/destruction
Browse files Browse the repository at this point in the history
Generate uevents when a user is being created/destroyed. These events
can be used to configure cpu share of a new user.

Signed-off-by: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Srivatsa Vaddagiri authored and Ingo Molnar committed Oct 15, 2007
1 parent 178be79 commit fb7dde3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kernel/user.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ static int user_kobject_create(struct user_struct *up)
if (error)
kobject_del(kobj);

kobject_uevent(kobj, KOBJ_ADD);

done:
return error;
}
Expand All @@ -189,6 +191,7 @@ int __init uids_kobject_init(void)

/* create under /sys/kernel dir */
uids_kobject.parent = &kernel_subsys.kobj;
uids_kobject.kset = &kernel_subsys;
kobject_set_name(&uids_kobject, "uids");
kobject_init(&uids_kobject);

Expand Down Expand Up @@ -228,6 +231,7 @@ static void remove_user_sysfs_dir(struct work_struct *w)
goto done;

sysfs_remove_file(kobj, &up->user_attr.attr);
kobject_uevent(kobj, KOBJ_REMOVE);
kobject_del(kobj);

sched_destroy_user(up);
Expand Down

0 comments on commit fb7dde3

Please sign in to comment.