All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC,PATCH 0/2] do_wait() wakeup optimization
@ 2009-06-22 17:04 Oleg Nesterov
       [not found] ` <93ad5f3f0906230955x357ff9evc334d4a5c6def20@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Oleg Nesterov @ 2009-06-22 17:04 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Ingo Molnar, Ratan Nalumasu, Roland McGrath, Vitaly Mayatskikh,
	linux-kernel

Now that we have struct wait_opts, it is easy to solve the problems with
unnecessary wakeups from __wake_up_parent(). See the previous discussion

	"+ do_wait-wakeup-optimization.patch added to -mm tree"
	http://marc.info/?t=122729873300001

However, this complicates the code a bit and adds bytes 112 to compiled
code.

Ratan, Roland, do you think this optimisation is worthwhile?

Oleg.


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

* Re: [RFC,PATCH 0/2] do_wait() wakeup optimization
       [not found] ` <93ad5f3f0906230955x357ff9evc334d4a5c6def20@mail.gmail.com>
@ 2009-06-23 14:30   ` Oleg Nesterov
       [not found]     ` <93ad5f3f0906240953v3b328f9bxca51cd9d3838d05c@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Oleg Nesterov @ 2009-06-23 14:30 UTC (permalink / raw)
  To: Ratan Nalumasu
  Cc: Andrew Morton, Ingo Molnar, Roland McGrath, Vitaly Mayatskikh,
	linux-kernel

On 06/23, Ratan Nalumasu wrote:
>
> Yes, it is something we really need. The specific case I have (hundreds of
> NTPL threads in a program, and each thread managing a child process), the
> CPU load is >99% with NTPL threads, near 0% with the patch
                                                   ^^^^^^^^^

Thanks. Did you test this patch, or do you mean the previous one?

> So, yes, the complication is worthwhile.

I am asking because I am not sure this change is enough, note the
"We can make child_wait_callback() more clever later" in the changelog.

__wake_up_parent() passes key = p, but we can pass more info and do
additional checks in child_wait_callback().

Oleg.


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

* Re: [RFC,PATCH 0/2] do_wait() wakeup optimization
       [not found]     ` <93ad5f3f0906240953v3b328f9bxca51cd9d3838d05c@mail.gmail.com>
@ 2009-06-24 15:41       ` Oleg Nesterov
  0 siblings, 0 replies; 3+ messages in thread
From: Oleg Nesterov @ 2009-06-24 15:41 UTC (permalink / raw)
  To: Ratan Nalumasu
  Cc: Andrew Morton, Ingo Molnar, Roland McGrath, Vitaly Mayatskikh,
	linux-kernel

On 06/24, Ratan Nalumasu wrote:
>
> On Tue, Jun 23, 2009 at 7:30 AM, Oleg Nesterov <oleg@redhat.com> wrote:
>
> > On 06/23, Ratan Nalumasu wrote:
> > >
> > > Yes, it is something we really need. The specific case I have (hundreds
> > of
> > > NTPL threads in a program, and each thread managing a child process), the
> > > CPU load is >99% with NTPL threads, near 0% with the patch
> >                                                    ^^^^^^^^^
> >
> > Thanks. Did you test this patch, or do you mean the previous one?
> >
>
> Sorry, I meant the previous patch. I realize that there are more steps to
> take before we get to a complete solution.

I think Roland has already showed us the necessary step.

I'd like to think a bit more before sending this patch, but any chance you
can test these 2 patches + "3/2" below?

Oleg.

--- WAIT/kernel/exit.c~	2009-06-22 18:55:08.000000000 +0200
+++ WAIT/kernel/exit.c	2009-06-24 17:32:03.000000000 +0200
@@ -1569,6 +1569,9 @@ static int child_wait_callback(wait_queu
 	if (!eligible_child(wo, p))
 		return 0;
 
+	if ((wo->wo_flags & __WNOTHREAD) && wait->private != p->parent)
+		return 0;
+
 	return default_wake_function(wait, mode, sync, key);
 }
 


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

end of thread, other threads:[~2009-06-24 18:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-22 17:04 [RFC,PATCH 0/2] do_wait() wakeup optimization Oleg Nesterov
     [not found] ` <93ad5f3f0906230955x357ff9evc334d4a5c6def20@mail.gmail.com>
2009-06-23 14:30   ` Oleg Nesterov
     [not found]     ` <93ad5f3f0906240953v3b328f9bxca51cd9d3838d05c@mail.gmail.com>
2009-06-24 15:41       ` Oleg Nesterov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.