linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@au1.ibm.com>
To: "Tseng-Hui (Frank) Lin" <thlin@linux.vnet.ibm.com>
Cc: tsenglin@us.ibm.com, linuxppc-dev@ozlabs.org
Subject: Re: [PATCH v4 2/2] add icswx support
Date: Sat, 05 Mar 2011 09:40:41 +1100	[thread overview]
Message-ID: <1299278441.8833.915.camel@pasglop> (raw)
In-Reply-To: <1299277344.28840.79.camel@flin.austin.ibm.com>

On Fri, 2011-03-04 at 16:22 -0600, Tseng-Hui (Frank) Lin wrote:

> > Well, I don't know how you use icswx on P7+, but on Prism it's
> > definitely issued directly by userspace.
> > 
> OK. You've got a point. I wasn't aware of Prism. HFI device driver is
> currently the only icswx user on P7. Could you point me to more
> information about how Prism uses icswx from user space?

Let's ignore that for now, there's a whole infrastructure for it and it
hasn't been published yet, maybe later this year... We can look at
exposing the feature to userspace then.

> > You don't need to. You allocate and initialize the structure, and you
> > compare & swap the pointer. If somebody beat you, you trash your copy. 
> > 
> Is atomic_cmpxchg() the one to do the trick?

No, just cmpxchg()

> The lazy switching checks the shadow variable first before setting ACOP
> register. This saves mtspr() only if the new value is the same as
> current. If there are several coprocessors on the system, the ACOP
> register may have to be changed frequently. In that case, the lazy
> switching will not save time. In extreme case when the ACOP register
> needs to be changed every time, it actually slows down the execution by
> the additional shadow variable checking.

By how much ? Is it even measurable ?

Cheers,
Ben.

  reply	other threads:[~2011-03-04 22:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-02 17:20 [PATCH v4 2/2] add icswx support Tseng-Hui (Frank) Lin
2011-03-04  1:02 ` Benjamin Herrenschmidt
2011-03-04 17:29   ` Tseng-Hui (Frank) Lin
2011-03-04 20:26     ` Benjamin Herrenschmidt
2011-03-04 22:22       ` Tseng-Hui (Frank) Lin
2011-03-04 22:40         ` Benjamin Herrenschmidt [this message]
2011-03-04 23:07           ` Tseng-Hui (Frank) Lin
2011-03-04 23:13             ` 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=1299278441.8833.915.camel@pasglop \
    --to=benh@au1.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=thlin@linux.vnet.ibm.com \
    --cc=tsenglin@us.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 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).