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 07:26:57 +1100	[thread overview]
Message-ID: <1299270417.8833.897.camel@pasglop> (raw)
In-Reply-To: <1299259794.28840.57.camel@flin.austin.ibm.com>

On Fri, 2011-03-04 at 11:29 -0600, Tseng-Hui (Frank) Lin wrote:
> On Fri, 2011-03-04 at 12:02 +1100, Benjamin Herrenschmidt wrote:
> > On Wed, 2011-03-02 at 11:20 -0600, Tseng-Hui (Frank) Lin wrote:
> > 
> > > +#define CPU_FTR_ICSWX                  LONG_ASM_CONST(0x1000000000000000)
> > 
> > Do we want a userspace visible feature as well ? Or some other way to
> > inform userspace that we support icswx ?
> > 
> Does a user space program really need to know about icswx? Only
> coprocessor drivers need to know about icswx. Shouldn't user space
> programs talk to the coprocessor drivers instead? 

Well, I don't know how you use icswx on P7+, but on Prism it's
definitely issued directly by userspace.

> Thought about that. However, multiple threads can call use_cop() at the
> same time. Without the spinlock being setup in advance, how do I
> guarantee allocating struct copro_data and modifying the pointer in the
> mm_context to be atomic?

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. 

> > I'm not sure I totally get the point of having an ifdef here. Can't you
> > make it unconditional ? Or do you expect distros to turn that off in
> > which case what's the point ?
> > 
> There is only one coprocessor, HFI, using icswx at this moment. The lazy
> switching makes sense. However, in the future, if more types of
> coprocessors are added, the lazy switching may actually be a bad idea.
> This option allows users to turn off the lazy switching.

No user in real life plays with kernel config options. Care to explain
why the lazy switching would be a problem ?

> Same concern as above. I need something initialized in advance to
> guarantee allocating memory and updating the pointer are safe when it
> happens in use_cop().

No you don't, see above.

Cheers,
Ben.

  reply	other threads:[~2011-03-04 20:27 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 [this message]
2011-03-04 22:22       ` Tseng-Hui (Frank) Lin
2011-03-04 22:40         ` Benjamin Herrenschmidt
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=1299270417.8833.897.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).