mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] worker_thread: don't play with SIGCHLD
@ 2007-04-13  7:29 Oleg Nesterov
  2007-04-13 13:21 ` Eric W. Biederman
  0 siblings, 1 reply; 4+ messages in thread
From: Oleg Nesterov @ 2007-04-13  7:29 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Eric W. Biederman, linux-kernel

depends on Eric's

	kthread-dont-depend-on-work-queues-take-2.patch

worker_thread() inherits ignored SIGCHLD from its parent, kthreadd.
We can remove unneeded do_sigaction().

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>

--- OLD/kernel/workqueue.c~wt	2007-04-05 12:20:35.000000000 +0400
+++ OLD/kernel/workqueue.c	2007-04-13 11:21:43.000000000 +0400
@@ -289,7 +289,6 @@ static int worker_thread(void *__cwq)
 {
 	struct cpu_workqueue_struct *cwq = __cwq;
 	DEFINE_WAIT(wait);
-	struct k_sigaction sa;
 
 	if (!cwq->wq->freezeable)
 		current->flags |= PF_NOFREEZE;
@@ -300,12 +299,6 @@ static int worker_thread(void *__cwq)
 	 */
 	numa_default_policy();
 
-	/* SIG_IGN makes children autoreap: see do_notify_parent(). */
-	sa.sa.sa_handler = SIG_IGN;
-	sa.sa.sa_flags = 0;
-	siginitset(&sa.sa.sa_mask, sigmask(SIGCHLD));
-	do_sigaction(SIGCHLD, &sa, (struct k_sigaction *)0);
-
 	for (;;) {
 		if (cwq->wq->freezeable)
 			try_to_freeze();


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] worker_thread: don't play with SIGCHLD
  2007-04-13  7:29 [PATCH] worker_thread: don't play with SIGCHLD Oleg Nesterov
@ 2007-04-13 13:21 ` Eric W. Biederman
  2007-04-13 13:40   ` Oleg Nesterov
  0 siblings, 1 reply; 4+ messages in thread
From: Eric W. Biederman @ 2007-04-13 13:21 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: Andrew Morton, linux-kernel

Oleg Nesterov <oleg@tv-sign.ru> writes:

> depends on Eric's
>
> 	kthread-dont-depend-on-work-queues-take-2.patch
>
> worker_thread() inherits ignored SIGCHLD from its parent, kthreadd.
> We can remove unneeded do_sigaction().

Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>

Looks good.

We could delete all of:

> 	set_user_nice(current, -5);
> 
> 	/* Block and flush all signals */
> 	sigfillset(&blocked);
> 	sigprocmask(SIG_BLOCK, &blocked, NULL);
> 	flush_signals(current);
> 
> 	/*
> 	 * We inherited MPOL_INTERLEAVE from the booting kernel.
> 	 * Set MPOL_DEFAULT to insure node local allocations.
> 	 */
> 	numa_default_policy();
> 
> 	/* SIG_IGN makes children autoreap: see do_notify_parent(). */
> 	sa.sa.sa_handler = SIG_IGN;
> 	sa.sa.sa_flags = 0;
> 	siginitset(&sa.sa.sa_mask, sigmask(SIGCHLD));
> 	do_sigaction(SIGCHLD, &sa, (struct k_sigaction *)0);

If we wanted to, as that all comes by default from kthreadd.

Eric

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] worker_thread: don't play with SIGCHLD
  2007-04-13 13:21 ` Eric W. Biederman
@ 2007-04-13 13:40   ` Oleg Nesterov
  2007-04-13 13:54     ` [PATCH] worker_thread: don't play with SIGCHLD and numa policy Oleg Nesterov
  0 siblings, 1 reply; 4+ messages in thread
From: Oleg Nesterov @ 2007-04-13 13:40 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: Andrew Morton, linux-kernel

On 04/13, Eric W. Biederman wrote:
>
> Oleg Nesterov <oleg@tv-sign.ru> writes:
> 
> > depends on Eric's
> >
> > 	kthread-dont-depend-on-work-queues-take-2.patch
> >
> > worker_thread() inherits ignored SIGCHLD from its parent, kthreadd.
> > We can remove unneeded do_sigaction().
> 
> Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
> 
> Looks good.
> 
> We could delete all of:
> 
> > 	set_user_nice(current, -5);
> > 
> > 	/* Block and flush all signals */
> > 	sigfillset(&blocked);
> > 	sigprocmask(SIG_BLOCK, &blocked, NULL);
> > 	flush_signals(current);

this one is already deleted in -mm...

> > 	/*
> > 	 * We inherited MPOL_INTERLEAVE from the booting kernel.
> > 	 * Set MPOL_DEFAULT to insure node local allocations.
> > 	 */
> > 	numa_default_policy();

Yes, I forgot about this!

> If we wanted to, as that all comes by default from kthreadd.

Thanks, will send an update.

Oleg.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] worker_thread: don't play with SIGCHLD and numa policy
  2007-04-13 13:40   ` Oleg Nesterov
@ 2007-04-13 13:54     ` Oleg Nesterov
  0 siblings, 0 replies; 4+ messages in thread
From: Oleg Nesterov @ 2007-04-13 13:54 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: Andrew Morton, linux-kernel

depends on Eric's

	kthread-dont-depend-on-work-queues-take-2.patch

worker_thread() inherits ignored SIGCHLD and numa_default_policy() from its
parent, kthreadd. No need to setup this again.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>

--- OLD/kernel/workqueue.c~wt	2007-04-05 12:20:35.000000000 +0400
+++ OLD/kernel/workqueue.c	2007-04-13 17:43:23.000000000 +0400
@@ -289,23 +289,10 @@ static int worker_thread(void *__cwq)
 {
 	struct cpu_workqueue_struct *cwq = __cwq;
 	DEFINE_WAIT(wait);
-	struct k_sigaction sa;
 
 	if (!cwq->wq->freezeable)
 		current->flags |= PF_NOFREEZE;
 
-	/*
-	 * We inherited MPOL_INTERLEAVE from the booting kernel.
-	 * Set MPOL_DEFAULT to insure node local allocations.
-	 */
-	numa_default_policy();
-
-	/* SIG_IGN makes children autoreap: see do_notify_parent(). */
-	sa.sa.sa_handler = SIG_IGN;
-	sa.sa.sa_flags = 0;
-	siginitset(&sa.sa.sa_mask, sigmask(SIGCHLD));
-	do_sigaction(SIGCHLD, &sa, (struct k_sigaction *)0);
-
 	for (;;) {
 		if (cwq->wq->freezeable)
 			try_to_freeze();


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-04-13 13:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-13  7:29 [PATCH] worker_thread: don't play with SIGCHLD Oleg Nesterov
2007-04-13 13:21 ` Eric W. Biederman
2007-04-13 13:40   ` Oleg Nesterov
2007-04-13 13:54     ` [PATCH] worker_thread: don't play with SIGCHLD and numa policy Oleg Nesterov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®