* [PATCH] c/r: make ckpt_debug() safe if called by dead tasks
@ 2009-09-24 21:04 Oren Laadan
[not found] ` <1253826292-23452-1-git-send-email-orenl-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Oren Laadan @ 2009-09-24 21:04 UTC (permalink / raw)
To: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
From: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
One may not call task_pid_vnr() on dead tasks because they don't have
a valid ->nxproxy pointer. However, the ckpt_ctx cleanup may be called
by a dead task from do_exit(), in the case of zombie or "ghost" tasks.
This patch makes ckpt_debug() safe to call from dead tasks context, so
that debug printing from code called by ckpt_ctx_free() is cool.
Signed-off-by: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
---
include/linux/checkpoint.h | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/include/linux/checkpoint.h b/include/linux/checkpoint.h
index e00dd70..5294a96 100644
--- a/include/linux/checkpoint.h
+++ b/include/linux/checkpoint.h
@@ -334,7 +334,9 @@ extern unsigned long ckpt_debug_level;
do { \
if (ckpt_debug_level & (level)) \
printk(KERN_DEBUG "[%d:%d:c/r:%s:%d] " fmt, \
- current->pid, task_pid_vnr(current), \
+ current->pid, \
+ current->nsproxy ? \
+ task_pid_vnr(current) : -1, \
__func__, __LINE__, ## args); \
} while (0)
--
1.6.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread[parent not found: <1253826292-23452-1-git-send-email-orenl-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org>]
* Re: [PATCH] c/r: make ckpt_debug() safe if called by dead tasks [not found] ` <1253826292-23452-1-git-send-email-orenl-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org> @ 2009-09-24 23:23 ` Serge E. Hallyn 0 siblings, 0 replies; 2+ messages in thread From: Serge E. Hallyn @ 2009-09-24 23:23 UTC (permalink / raw) To: Oren Laadan; +Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA Quoting Oren Laadan (orenl-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org): > From: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org> > > One may not call task_pid_vnr() on dead tasks because they don't have > a valid ->nxproxy pointer. However, the ckpt_ctx cleanup may be called > by a dead task from do_exit(), in the case of zombie or "ghost" tasks. > > This patch makes ckpt_debug() safe to call from dead tasks context, so > that debug printing from code called by ckpt_ctx_free() is cool. > > Signed-off-by: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org> Acked-by: Serge Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> thanks, -serge > --- > include/linux/checkpoint.h | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/include/linux/checkpoint.h b/include/linux/checkpoint.h > index e00dd70..5294a96 100644 > --- a/include/linux/checkpoint.h > +++ b/include/linux/checkpoint.h > @@ -334,7 +334,9 @@ extern unsigned long ckpt_debug_level; > do { \ > if (ckpt_debug_level & (level)) \ > printk(KERN_DEBUG "[%d:%d:c/r:%s:%d] " fmt, \ > - current->pid, task_pid_vnr(current), \ > + current->pid, \ > + current->nsproxy ? \ > + task_pid_vnr(current) : -1, \ > __func__, __LINE__, ## args); \ > } while (0) > > -- > 1.6.0.4 > > _______________________________________________ > Containers mailing list > Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org > https://lists.linux-foundation.org/mailman/listinfo/containers ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-09-24 23:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-24 21:04 [PATCH] c/r: make ckpt_debug() safe if called by dead tasks Oren Laadan
[not found] ` <1253826292-23452-1-git-send-email-orenl-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org>
2009-09-24 23:23 ` Serge E. Hallyn
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox