lkml.org 
[lkml]   [2013]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 1/5] vfork: don't freezer_count() for in-kernel users of CLONE_VFORK
    Date
    We don't need to call freezer_do_not_count() for in-kernel users
    of CLONE_VFORK since exec will get called in bounded time.

    We don't want to call freezer_count() for in-kernel users because
    they may be holding locks. freezer_count() calls try_to_freeze().
    We don't want to freeze an in-kernel user because it may be
    holding locks.

    In a follow-up patch, I call debug_check_no_locks_held() from
    try_to_freeze(). After applying this patch, I get no lockdep
    warnings with that patch.

    Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
    CC: Oleg Nesterov <oleg@redhat.com>
    CC: Tejun Heo <tj@kernel.org>
    CC: Andrew Morton <akpm@linux-foundation.org>
    CC: Rafael J. Wysocki <rjw@sisk.pl>
    CC: Ingo Molnar <mingo@redhat.com>
    ---
    kernel/fork.c | 6 ++++--
    1 file changed, 4 insertions(+), 2 deletions(-)

    diff --git a/kernel/fork.c b/kernel/fork.c
    index c535f33..a7cd973 100644
    --- a/kernel/fork.c
    +++ b/kernel/fork.c
    @@ -722,9 +722,11 @@ static int wait_for_vfork_done(struct task_struct *child,
    {
    int killed;

    - freezer_do_not_count();
    + if (current->mm)
    + freezer_do_not_count();
    killed = wait_for_completion_killable(vfork);
    - freezer_count();
    + if (current->mm)
    + freezer_count();

    if (killed) {
    task_lock(child);
    --
    1.8.1


    \
     
     \ /
      Last update: 2013-02-15 01:22    [W:2.177 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site