All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Philippe Elie <phil.el@wanadoo.fr>,
	linuxppc <linuxppc-dev@ozlabs.org>,
	Bob Nelson <rrnelson@linux.vnet.ibm.com>,
	oprofile <oprofile-list@lists.sourceforge.net>,
	Andrew Morton <akpm@linuxfoundation.org>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH 1/2] Enable SPU switch notification to detect currently active SPU tasks.
Date: Fri, 13 Jul 2007 14:45:02 +0200	[thread overview]
Message-ID: <20070713124502.GA26544@lst.de> (raw)
In-Reply-To: <1184330090.6059.219.camel@localhost.localdomain>

On Fri, Jul 13, 2007 at 10:34:50PM +1000, Benjamin Herrenschmidt wrote:
> 
> > > +		if (unlikely(test_bit(SPU_SCHED_NOTIFY_ACTIVE,
> > > +				      &ctx->sched_flags))) {
> > > +			clear_bit(SPU_SCHED_NOTIFY_ACTIVE, &ctx->sched_flags);
> > 
> > this should use test_and_clear_bit
> 
> This also looks like an abuse of atomics to effectively implement a lock
> or did I miss something ?

not really.  We set a flag on the context to make sure some action is
performed when it comes through spu_run the next time.  It's not exactly
elegant, but cleaning this up will have to wait for the grand spu_run
rewrite.

  reply	other threads:[~2007-07-13 12:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-12 23:45 [PATCH 1/2] Enable SPU switch notification to detect currently active SPU tasks Bob Nelson
2007-07-13 10:12 ` Christoph Hellwig
2007-07-13 10:13   ` Christoph Hellwig
2007-07-13 12:34   ` Benjamin Herrenschmidt
2007-07-13 12:45     ` Christoph Hellwig [this message]
2007-07-13 13:25   ` Christoph Hellwig

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=20070713124502.GA26544@lst.de \
    --to=hch@lst.de \
    --cc=akpm@linuxfoundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=oprofile-list@lists.sourceforge.net \
    --cc=phil.el@wanadoo.fr \
    --cc=rrnelson@linux.vnet.ibm.com \
    /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 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.