From: Mandeep Singh Baines <msb@chromium.org>
To: linux-kernel@vger.kernel.org
Cc: Mandeep Singh Baines <msb@chromium.org>,
Oleg Nesterov <oleg@redhat.com>, Tejun Heo <tj@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
"Rafael J. Wysocki" <rjw@sisk.pl>, Ingo Molnar <mingo@redhat.com>
Subject: [PATCH 1/5] vfork: don't freezer_count() for in-kernel users of CLONE_VFORK
Date: Thu, 14 Feb 2013 15:38:12 -0800 [thread overview]
Message-ID: <1360885096-21207-1-git-send-email-msb@chromium.org> (raw)
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
next reply other threads:[~2013-02-14 23:38 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-14 23:38 Mandeep Singh Baines [this message]
2013-02-14 23:38 ` [PATCH 2/5] lockdep: check that no locks held at freeze time Mandeep Singh Baines
2013-02-15 11:16 ` Ingo Molnar
2013-02-15 15:44 ` Oleg Nesterov
2013-02-14 23:38 ` [PATCH 3/5] coredump: cleanup the waiting for coredump_finish code Mandeep Singh Baines
2013-02-15 14:53 ` Oleg Nesterov
2013-02-15 23:30 ` Andrew Morton
2013-02-14 23:38 ` [PATCH 4/5] coredump: use a freezable_schedule for the coredump_finish wait Mandeep Singh Baines
2013-02-14 23:38 ` [PATCH 5/5] coredump: abort core dump piping only due to a fatal signal Mandeep Singh Baines
2013-02-15 15:01 ` Oleg Nesterov
2013-02-16 1:20 ` Mandeep Singh Baines
2013-02-16 17:05 ` Oleg Nesterov
2013-02-15 23:25 ` Andrew Morton
2013-02-16 0:09 ` [PATCH v3] coredump: ignore non-fatal signals when core dumping to a pipe Mandeep Singh Baines
2013-02-16 0:57 ` [PATCH v4] " Mandeep Singh Baines
2013-02-15 15:28 ` [PATCH 1/5] vfork: don't freezer_count() for in-kernel users of CLONE_VFORK Oleg Nesterov
-- strict thread matches above, loose matches on Subject: below --
2013-02-16 9:53 Mandeep Singh Baines
2013-02-16 17:05 ` Oleg Nesterov
2013-02-20 0:07 ` Mandeep Singh Baines
2013-02-20 1:41 ` Mandeep Singh Baines
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1360885096-21207-1-git-send-email-msb@chromium.org \
--to=msb@chromium.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=oleg@redhat.com \
--cc=rjw@sisk.pl \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).