All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Shreyas B Prabhu <shreyas@linux.vnet.ibm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	linux-kernel@vger.kernel.org, Paul Mackerras <paulus@samba.org>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [RFC, v2] powerpc/powernv: Introduce kernel param to control fastsleep workaround behavior
Date: Wed, 18 Mar 2015 15:55:59 +1100	[thread overview]
Message-ID: <1426654559.6504.3.camel@ellerman.id.au> (raw)
In-Reply-To: <55084D0C.1040309@linux.vnet.ibm.com>

On Tue, 2015-03-17 at 21:19 +0530, Shreyas B Prabhu wrote:
> 
> On Tuesday 17 March 2015 03:09 PM, Benjamin Herrenschmidt wrote:
> > On Tue, 2015-03-17 at 19:57 +1100, Michael Ellerman wrote:
> >>
> >> >From what I can see below, the decision as to whether you apply the workaround
> >> or not doesn't affect the list of idle states. So this could just as well be a
> >> runtime parameter, ie. a sysfs file, which can then be set by the user whenever
> >> they like? They might do it in a boot script, but that's up to them.
> > 
> > Right, that would work too.
> 
> Okay. I'll send a patch with this design.

Thanks.

> >> For simplicity I think it would also be fine to make it a write-once parameter,
> >> ie. you don't need to handle undoing it.
> > 
> > It would be easy enough to make it rw using stop machine I think... 
> > 
> >> I think the only complication that would add is that you'd need to be a little
> >> careful about the order in which you nop out the calls vs applying the
> >> workaround, in case some threads are idle when you're called.
> 
> Right, we should be safe with this sequence-
> - NOP call to undo workaround
> - Apply workaround on all cores.
> - NOP call to apply workaround
 
Yeah that sounds right.

> > I wouldn't bother with NOP'ing in that case, a runtime test will probably be noise
> > in the measurement.
> 
> Didn't get your point here. Do you mean, ignore the request if some
> cores are in sleep or deeper state?

I *think* what he means is we probably don't actually need to patch a nop
in/out. Instead we could just test a flag, because the cost of testing a flag
is miniscule compared to the rest of the logic.

cheers



WARNING: multiple messages have this Message-ID (diff)
From: Michael Ellerman <mpe@ellerman.id.au>
To: Shreyas B Prabhu <shreyas@linux.vnet.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org, Paul Mackerras <paulus@samba.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC, v2] powerpc/powernv: Introduce kernel param to control fastsleep workaround behavior
Date: Wed, 18 Mar 2015 15:55:59 +1100	[thread overview]
Message-ID: <1426654559.6504.3.camel@ellerman.id.au> (raw)
In-Reply-To: <55084D0C.1040309@linux.vnet.ibm.com>

On Tue, 2015-03-17 at 21:19 +0530, Shreyas B Prabhu wrote:
> 
> On Tuesday 17 March 2015 03:09 PM, Benjamin Herrenschmidt wrote:
> > On Tue, 2015-03-17 at 19:57 +1100, Michael Ellerman wrote:
> >>
> >> >From what I can see below, the decision as to whether you apply the workaround
> >> or not doesn't affect the list of idle states. So this could just as well be a
> >> runtime parameter, ie. a sysfs file, which can then be set by the user whenever
> >> they like? They might do it in a boot script, but that's up to them.
> > 
> > Right, that would work too.
> 
> Okay. I'll send a patch with this design.

Thanks.

> >> For simplicity I think it would also be fine to make it a write-once parameter,
> >> ie. you don't need to handle undoing it.
> > 
> > It would be easy enough to make it rw using stop machine I think... 
> > 
> >> I think the only complication that would add is that you'd need to be a little
> >> careful about the order in which you nop out the calls vs applying the
> >> workaround, in case some threads are idle when you're called.
> 
> Right, we should be safe with this sequence-
> - NOP call to undo workaround
> - Apply workaround on all cores.
> - NOP call to apply workaround
 
Yeah that sounds right.

> > I wouldn't bother with NOP'ing in that case, a runtime test will probably be noise
> > in the measurement.
> 
> Didn't get your point here. Do you mean, ignore the request if some
> cores are in sleep or deeper state?

I *think* what he means is we probably don't actually need to patch a nop
in/out. Instead we could just test a flag, because the cost of testing a flag
is miniscule compared to the rest of the logic.

cheers

  reply	other threads:[~2015-03-18  4:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-17  4:13 [PATCH RFC v2] powerpc/powernv: Introduce kernel param to control fastsleep workaround behavior Shreyas B. Prabhu
2015-03-17  4:13 ` Shreyas B. Prabhu
2015-03-17  8:57 ` [RFC, " Michael Ellerman
2015-03-17  9:39   ` Benjamin Herrenschmidt
2015-03-17  9:39     ` Benjamin Herrenschmidt
2015-03-17 15:49     ` Shreyas B Prabhu
2015-03-17 15:49       ` Shreyas B Prabhu
2015-03-18  4:55       ` Michael Ellerman [this message]
2015-03-18  4:55         ` Michael Ellerman

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=1426654559.6504.3.camel@ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.org \
    --cc=shreyas@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.