All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maynard Johnson <maynardj@us.ibm.com>
To: Luke Browning <LukeBrowning@us.ibm.com>
Cc: maynardj@linux.vnet.ibm.com,
	Arnd Bergmann <arnd.bergmann@de.ibm.com>,
	linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org,
	oprofile-list@lists.sourceforge.net, cbe-oss-dev@ozlabs.org
Subject: Re: [Cbe-oss-dev] [PATCH]Add notification for active Cell SPU tasks
Date: Tue, 12 Dec 2006 08:47:46 -0600	[thread overview]
Message-ID: <457EC112.3020204@us.ibm.com> (raw)
In-Reply-To: <OFD47C2157.B38B81D4-ON8325723E.00687BA3-8325723E.0069669F@us.ibm.com>

Luke Browning wrote:
> maynardj@linux.vnet.ibm.com wrote on 08/12/2006 01:04:30 PM:
> 
>  > Arnd Bergmann wrote:
>  >
>  > >On Wednesday 06 December 2006 23:04, Maynard Johnson wrote:
>  > >  
>  > >No code should ever need to look at other SPUs when performing an
>  > >operation on a given SPU, so we don't need to hold a global lock
>  > >during normal operation.
>  > >
>  > >We have two cases that need to be handled:
>  > >
>  > >- on each context unload and load (both for a full switch operation),
>  > >  call to the profiling code with a pointer to the current context
>  > >  and spu (context is NULL when unloading).
>  > >
>  > >  If the new context is not know yet, scan its overlay table (expensive)
>  > >  and store information about it in an oprofile private object. 
> Otherwise
>  > >  just point to the currently active object, this should be really 
> cheap.
>  > >
>  > >- When enabling oprofile initially, scan all contexts that are currently
>  > >  running on one of the SPUs. This is also expensive, but should happen
>  > >  before the measurement starts so it does not impact the resulting 
> data.
>  > >
> 
> Agreed.  
> 
> <snip>
> 
>  > >>I'm not exactly sure what you're saying here.  Are you suggesting 
> that a
>  > >>user may only be interested in acitve SPU notification and, therefore,
>  > >>shouldn't have to be depenent on the "standard" notification
>  > >>registration succeeding?  There may be a case for adding a new
>  > >>registration function, I suppose; although, I'm not aware of any other
>  > >>users of the SPUFS notification mechanism besides OProfile and PDT, 
> and
>  > >>we need notification of both active and future SPU tasks.  But I would
>  > >>not object to a new function.
>  > >>
>  > >>    
>  > >>
>  > >I think what Luke was trying to get to is that notify_spus_active() 
> should
>  > >not call blocking_notifier_call_chain(), since it will notify other 
> users
>  > >as well as the newly registered one. Instead, it can simply call the
>  > >notifier function directly.
>  > >  
>  > >
>  > Ah, yes.  Thanks to both of you for pointing that out.  I'll fix that
>  > and re-post.
>  >
>  > -Maynard
>  >
> 
> I actually was hoping to take this one step further.  If the interface to
> the context switch handler is something like:
> 
> switch_handler(int spu_id, from_ctx, to_ctx)
The function prototype for the switch handler is set in concrete by the 
notification framework.  The parameters are: struct notifier_block *, 
unsigned long, void *.
> 
> The kernel extension can maintain an internal spu table of its own where it
> marks the named spuid as active or not.  You don't need to have a bunch of
> individual calls.  Internally, you can keep track of it yourself.
I think this would be nice to have, and I will look into it as I have 
time.  However, for the existing usage of the SPU switch notification, I 
don't think it's too critical, since most users are not going to be 
trying to do profiling or debugging with multiple SPU apps running 
simultaneously.
> 
> Luke
> 

WARNING: multiple messages have this Message-ID (diff)
From: Maynard Johnson <maynardj@us.ibm.com>
To: Luke Browning <LukeBrowning@us.ibm.com>
Cc: maynardj@linux.vnet.ibm.com,
	Arnd Bergmann <arnd.bergmann@de.ibm.com>,
	cbe-oss-dev@ozlabs.org, linux-kernel@vger.kernel.org,
	linuxppc-dev@ozlabs.org, oprofile-list@lists.sourceforge.net
Subject: Re: [Cbe-oss-dev] [PATCH]Add notification for active Cell SPU tasks
Date: Tue, 12 Dec 2006 08:47:46 -0600	[thread overview]
Message-ID: <457EC112.3020204@us.ibm.com> (raw)
In-Reply-To: <OFD47C2157.B38B81D4-ON8325723E.00687BA3-8325723E.0069669F@us.ibm.com>

Luke Browning wrote:
> maynardj@linux.vnet.ibm.com wrote on 08/12/2006 01:04:30 PM:
> 
>  > Arnd Bergmann wrote:
>  >
>  > >On Wednesday 06 December 2006 23:04, Maynard Johnson wrote:
>  > >  
>  > >No code should ever need to look at other SPUs when performing an
>  > >operation on a given SPU, so we don't need to hold a global lock
>  > >during normal operation.
>  > >
>  > >We have two cases that need to be handled:
>  > >
>  > >- on each context unload and load (both for a full switch operation),
>  > >  call to the profiling code with a pointer to the current context
>  > >  and spu (context is NULL when unloading).
>  > >
>  > >  If the new context is not know yet, scan its overlay table (expensive)
>  > >  and store information about it in an oprofile private object. 
> Otherwise
>  > >  just point to the currently active object, this should be really 
> cheap.
>  > >
>  > >- When enabling oprofile initially, scan all contexts that are currently
>  > >  running on one of the SPUs. This is also expensive, but should happen
>  > >  before the measurement starts so it does not impact the resulting 
> data.
>  > >
> 
> Agreed.  
> 
> <snip>
> 
>  > >>I'm not exactly sure what you're saying here.  Are you suggesting 
> that a
>  > >>user may only be interested in acitve SPU notification and, therefore,
>  > >>shouldn't have to be depenent on the "standard" notification
>  > >>registration succeeding?  There may be a case for adding a new
>  > >>registration function, I suppose; although, I'm not aware of any other
>  > >>users of the SPUFS notification mechanism besides OProfile and PDT, 
> and
>  > >>we need notification of both active and future SPU tasks.  But I would
>  > >>not object to a new function.
>  > >>
>  > >>    
>  > >>
>  > >I think what Luke was trying to get to is that notify_spus_active() 
> should
>  > >not call blocking_notifier_call_chain(), since it will notify other 
> users
>  > >as well as the newly registered one. Instead, it can simply call the
>  > >notifier function directly.
>  > >  
>  > >
>  > Ah, yes.  Thanks to both of you for pointing that out.  I'll fix that
>  > and re-post.
>  >
>  > -Maynard
>  >
> 
> I actually was hoping to take this one step further.  If the interface to
> the context switch handler is something like:
> 
> switch_handler(int spu_id, from_ctx, to_ctx)
The function prototype for the switch handler is set in concrete by the 
notification framework.  The parameters are: struct notifier_block *, 
unsigned long, void *.
> 
> The kernel extension can maintain an internal spu table of its own where it
> marks the named spuid as active or not.  You don't need to have a bunch of
> individual calls.  Internally, you can keep track of it yourself.
I think this would be nice to have, and I will look into it as I have 
time.  However, for the existing usage of the SPU switch notification, I 
don't think it's too critical, since most users are not going to be 
trying to do profiling or debugging with multiple SPU apps running 
simultaneously.
> 
> Luke
> 



  reply	other threads:[~2006-12-12 14:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-01 20:01 [PATCH]Add notification for active Cell SPU tasks Maynard Johnson
2006-12-02 20:00 ` [Cbe-oss-dev] " Arnd Bergmann
2006-12-02 20:00   ` Arnd Bergmann
2006-12-04 15:36   ` Maynard Johnson
2006-12-04 15:36     ` Maynard Johnson
2006-12-04 12:26 ` Luke Browning
2006-12-06 19:30   ` Luke Browning
2006-12-06 22:04     ` Maynard Johnson
2006-12-06 22:04       ` Maynard Johnson
2006-12-07 22:58       ` [Cbe-oss-dev] " Arnd Bergmann
2006-12-07 22:58         ` Arnd Bergmann
2006-12-08 15:04         ` Maynard Johnson
2006-12-08 15:04           ` Maynard Johnson
2006-12-08 19:11           ` Luke Browning
2006-12-12 14:47             ` Maynard Johnson [this message]
2006-12-12 14:47               ` Maynard Johnson

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=457EC112.3020204@us.ibm.com \
    --to=maynardj@us.ibm.com \
    --cc=LukeBrowning@us.ibm.com \
    --cc=arnd.bergmann@de.ibm.com \
    --cc=cbe-oss-dev@ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=maynardj@linux.vnet.ibm.com \
    --cc=oprofile-list@lists.sourceforge.net \
    /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.