Re: [PATCH]: exec: avoid propagating PF_NO_SETAFFINITY intouserspace child

From: Oleg Nesterov
Date: Tue Nov 26 2013 - 13:03:17 EST


On 11/26, zhang.yi20@xxxxxxxxxx wrote:
>
> Userspace process doesn't want the PF_NO_SETAFFINITY, but its parent may be
> a kernel worker thread which has PF_NO_SETAFFINITY set.

... and this worker thread can do kernel_thread() to create the child.

> Clearing this flag in usersapce child to enable its migrating capability.
>
>
> Signed-off-by: Zhang Yi <zhang.yi20@xxxxxxxxxx>
>
> --- linux-3.12.old/fs/exec.c 2013-11-26 08:53:12.175811856 +0000
> +++ linux-3.12/fs/exec.c 2013-11-26 09:26:53.575999604 +0000
> @@ -1091,7 +1091,8 @@ int flush_old_exec(struct linux_binprm *
>
> set_fs(USER_DS);
> current->flags &=
> - ~(PF_RANDOMIZE | PF_FORKNOEXEC | PF_KTHREAD | PF_NOFREEZE);
> + ~(PF_RANDOMIZE | PF_FORKNOEXEC | PF_KTHREAD | PF_NOFREEZE
> + | PF_NO_SETAFFINITY);

Thanks,

Acked-by: Oleg Nesterov <oleg@xxxxxxxxxx>




Can't resist... perhaps

current->flags &= ~(PF_RANDOMIZE | PF_FORKNOEXEC | PF_KTHREAD |
PF_NOFREEZE | PF_NO_SETAFFINITY);

looks a bit better, but this is minor and I won't insist.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/