linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Adrian Cox <adrian@humboldt.co.uk>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: Worst case performance of up()
Date: Tue, 05 Dec 2006 07:25:46 +1100	[thread overview]
Message-ID: <1165263946.29784.13.camel@localhost.localdomain> (raw)
In-Reply-To: <1165239794.17906.14.camel@localhost.localdomain>

On Mon, 2006-12-04 at 13:43 +0000, Adrian Cox wrote:
> On Sun, 2006-12-03 at 07:52 +1100, Benjamin Herrenschmidt wrote:
> > On Sat, 2006-12-02 at 11:54 +0000, Adrian Cox wrote:
> > > On Sat, 2006-12-02 at 22:15 +1100, Benjamin Herrenschmidt wrote:
> > > > I think we are hitting a livelock due to both CPUs trying to perform an
> > > > atomic operation on the same cache line (or same variable even).
> > > 
> > > I agree.
> 
> I now have this one identified and fixed. The cure is actually simple:
> on 32-bit SMP machines, rather than setting powersave_nap to 0, set
> ppc_md.power_save to NULL.
> 
> CPU A is attempting to reschedule the idle thread on CPU B:
> set_tsk_thread_flag(p, TIF_NEED_RESCHED);
> 
> CPU B is in the idle loop, but does not support nap. The result is that
> ppc6xx_idle() returns immediately, and CPU B runs in a tight loop:
> while(...) {
> 	set_thread_flag(TIF_POLLING_NRFLAG);
> 	...
> 	clear_thread_flag(TIF_POLLING_NRFLAG);
> }
> 
> If ppc_md.power_save is NULL, then the idle loop does not touch the flag
> word of the idle thread, and everything works.

Good to know, there might be other cases of performance issues due to
touching that flag in a loop...

Ben.

  reply	other threads:[~2006-12-04 20:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-24 16:21 Worst case performance of up() Adrian Cox
2006-11-24 20:45 ` Benjamin Herrenschmidt
2006-11-27 21:02   ` Adrian Cox
2006-12-02 10:35     ` Adrian Cox
2006-12-02 11:15       ` Benjamin Herrenschmidt
2006-12-02 11:54         ` Adrian Cox
2006-12-02 20:52           ` Benjamin Herrenschmidt
2006-12-04 13:43             ` Adrian Cox
2006-12-04 20:25               ` Benjamin Herrenschmidt [this message]
2006-12-05 22:00                 ` Benjamin Herrenschmidt
2006-12-08  2:33                   ` Paul Mackerras
2006-12-08  3:10                     ` Benjamin Herrenschmidt

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=1165263946.29784.13.camel@localhost.localdomain \
    --to=benh@kernel.crashing.org \
    --cc=adrian@humboldt.co.uk \
    --cc=linuxppc-dev@ozlabs.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).