Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142884
b: refs/heads/master
c: 1c99315
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Rusty Russell committed Apr 9, 2009
1 parent ac1b6a7 commit 999868b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3217ab97f14c5c8f9f975ed8c40c351164b0b10e
refs/heads/master: 1c99315bb36b5d776210546d438ca928dc9b1f22
22 changes: 11 additions & 11 deletions trunk/kernel/kthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,10 @@ static void create_kthread(struct kthread_create_info *create)

/* We want our own signal handler (we take no signals by default). */
pid = kernel_thread(kthread, create, CLONE_FS | CLONE_FILES | SIGCHLD);
if (pid < 0) {
if (pid < 0)
create->result = ERR_PTR(pid);
} else {
struct sched_param param = { .sched_priority = 0 };
else
wait_for_completion(&create->started);
/*
* root may have changed our (kthreadd's) priority or CPU mask.
* The kernel thread should not inherit these properties.
*/
sched_setscheduler(create->result, SCHED_NORMAL, &param);
set_user_nice(create->result, KTHREAD_NICE_LEVEL);
set_cpus_allowed_ptr(create->result, cpu_all_mask);
}
complete(&create->done);
}

Expand Down Expand Up @@ -152,11 +143,20 @@ struct task_struct *kthread_create(int (*threadfn)(void *data),
wait_for_completion(&create.done);

if (!IS_ERR(create.result)) {
struct sched_param param = { .sched_priority = 0 };
va_list args;

va_start(args, namefmt);
vsnprintf(create.result->comm, sizeof(create.result->comm),
namefmt, args);
va_end(args);
/*
* root may have changed our (kthreadd's) priority or CPU mask.
* The kernel thread should not inherit these properties.
*/
sched_setscheduler_nocheck(create.result, SCHED_NORMAL, &param);
set_user_nice(create.result, KTHREAD_NICE_LEVEL);
set_cpus_allowed_ptr(create.result, cpu_all_mask);
}
return create.result;
}
Expand Down

0 comments on commit 999868b

Please sign in to comment.