lkml.org 
[lkml]   [2014]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kthreads: kill CLONE_KERNEL, change kernel_thread(kernel_init) to avoid CLONE_SIGHAND
On 05/16, Sasha Levin wrote:
>
> On 04/13/2014 03:56 PM, Oleg Nesterov wrote:
> > 1. Remove CLONE_KERNEL, it has no users and it is dangerous.
> >
> > The (old) comment says "List of flags we want to share for kernel
> > threads" but this is not true, we do not want to share ->sighand by
> > default. This flag can only be used if the caller is sure that both
> > parent/child will never play with signals (say, allow_signal/etc).
> >
> > 2. Change rest_init() to clone kernel_init() without CLONE_SIGHAND.
> >
> > In this case CLONE_SIGHAND does not really hurt, and it looks like
> > optimization because copy_sighand() can avoid kmem_cache_alloc().
> >
> > But in fact this only adds the minor pessimization. kernel_init()
> > is going to exec the init process, and de_thread() will need to
> > unshare ->sighand and do kmem_cache_alloc(sighand_cachep) anyway,
> > but it needs to do more work and take tasklist_lock and siglock.
> >
> > Signed-off-by: Oleg Nesterov <oleg@redhat.com>
>
> Hi Oleg,
>
> This patch triggers a hang during boot in my KVM guest.

Hmm... How??? ;)

> There are no
> messages or anything, it just hangs right before init is supposed to
> start up.

Do you mean kernel_init() hangs somewhere in run_init_process() paths?

> I've narrowed it down a bit, and it's the removal of CLONE_SIGHAND
> that's bothering it.

This must not be possible, I bet there is something else which should
be fixed.

> Removing CLONE_FS and CLONE_FILES doesn't
> cause the hang on boot.

kernel_thread(kernel_init) doesn't use CLONE_FILES ?

Oleg.



\
 
 \ /
  Last update: 2014-05-17 19:01    [W:0.228 / U:0.584 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site