linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Markus Stockhausen <stockhausen@collogia.de>
Cc: "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	Herbert Xu <herbert@gondor.apana.org.au>
Subject: Re: SPE & Interrupt context (was how to make use of SPE instructions)
Date: Tue, 27 Jan 2015 22:21:23 -0600	[thread overview]
Message-ID: <1422418883.10544.73.camel@freescale.com> (raw)
In-Reply-To: <12EF8D94C6F8734FB2FF37B9FBEDD1735F915B69@EXCHANGE.collogia.de>

On Tue, 2015-01-27 at 05:09 +0000, Markus Stockhausen wrote:
> On Tue, 2015-01-20 at 14:53 +0000, Markus Stockhausen wrote:
> > > Von: Scott Wood [scottwood@freescale.com]
> > > Gesendet: Dienstag, 20. Januar 2015 08:38
> > > An: Markus Stockhausen
> > > Cc: Michael Ellerman; linuxppc-dev@lists.ozlabs.org
> > > Betreff: Re: AW: How to make use of SPE instructions?
> > > ...
> > > With your advice I would place a enable/disable preemption call after
> > > 1K of processed data. But wil that be sufficient if I only reeanble it
> > > for a short timeframe like this:
> > >
> > >   do {
> > >     disable_preemption()
> > >     ... calc hashes for 1K of data with 16.000 CPU cycles (or 20us) ...
> > >     enable_preemption()
> > >   while (dataleft>0);
> > 
> > Yes, it's sufficient.  When you enable preemption it will check to see
> > whether there is a pending reschedule.
> > 
> 
> Hi Scott,
> 
> thanks for your helpful feedback. As you might have seen I sent a first
> patch for the sha256 kernel module that takes care about preemption.
> 
> Herbert Xu noticed that my module won't run in for IPsec as all
> work will be done from interrupt context. Do you have a tip how I can
> mitigate the check I implemented:
> 
> static bool spe_usable(void)
> {
>   return !in_interrupt();
> }
> 
> Intel guys have something like that
> 
> bool irq_fpu_usable(void)
> {
>   return !in_interrupt() ||
>     interrupted_user_mode() ||
>     interrupted_kernel_fpu_idle();
> }
> 
> But I have no idea how to transfer it to the PPC/SPE case.

I'm not sure what sort of tip you're looking for, other than
implementing it myself. :-)

-Scott

  reply	other threads:[~2015-01-28  4:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-27  5:09 SPE & Interrupt context (was how to make use of SPE instructions) Markus Stockhausen
2015-01-28  4:21 ` Scott Wood [this message]
2015-01-28  5:00   ` AW: " Markus Stockhausen
2015-01-30  0:49     ` Scott Wood
2015-01-30  5:37       ` AW: " Markus Stockhausen
2015-01-30  8:49         ` Gabriel Paubert
2015-01-30  9:39           ` AW: " Markus Stockhausen
2015-01-30 10:41             ` Gabriel Paubert
2015-01-30 17:57               ` Scott Wood

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=1422418883.10544.73.camel@freescale.com \
    --to=scottwood@freescale.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=stockhausen@collogia.de \
    /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).