From: Oleg Nesterov copy_process: // holds tasklist_lock + ->siglock /* * inherit ioprio */ p->ioprio = current->ioprio; Why? ->ioprio was already copied in dup_task_struct(). I guess this is needed to ensure that the child can't escape sys_ioprio_set(IOPRIO_WHO_{PGRP,USER}), yes? In that case we don't need ->siglock held, and the comment should be updated. Signed-off-by: Oleg Nesterov Cc: Jens Axboe Signed-off-by: Andrew Morton --- kernel/fork.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff -puN kernel/fork.c~copy_process-cosmetic-ioprio-tweak kernel/fork.c --- a/kernel/fork.c~copy_process-cosmetic-ioprio-tweak +++ a/kernel/fork.c @@ -1146,7 +1146,6 @@ static struct task_struct *copy_process( /* Our parent execution domain becomes current domain These must match for thread signalling to apply */ - p->parent_exec_id = p->self_exec_id; /* ok, now we should be set up.. */ @@ -1169,6 +1168,9 @@ static struct task_struct *copy_process( /* Need tasklist lock for parent etc handling! */ write_lock_irq(&tasklist_lock); + /* for sys_ioprio_set(IOPRIO_WHO_PGRP) */ + p->ioprio = current->ioprio; + /* * The task hasn't been attached yet, so its cpus_allowed mask will * not be changed, nor will its assigned CPU. @@ -1228,11 +1230,6 @@ static struct task_struct *copy_process( } } - /* - * inherit ioprio - */ - p->ioprio = current->ioprio; - if (likely(p->pid)) { add_parent(p); if (unlikely(p->ptrace & PT_PTRACED)) _