linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Getting rid of i7300_idle's idle notifier?
@ 2015-06-04 23:32 Andy Lutomirski
  2015-06-05  0:31 ` Andy Lutomirski
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Lutomirski @ 2015-06-04 23:32 UTC (permalink / raw)
  To: Andy Henroid, linux-pm, linux-kernel, Peter Zijlstra, X86 ML,
	Matthew Garrett

AFAICT the sole purpose for the hideous x86_64 idle_notifier mess is
to support i7300_idle.  IMO this junk does not belong in IRQ handling,
etc.  Can we redo this to work in some kind of generic way?

I have no idea why it makes sense to twiddle I/O AT registers in the
beginning of whatever IRQ wakes up the CPU.

Note that, if absolutely necessary, the ECX bit 0 MWAIT extension can
be used to reliably execute code before handling interrupts that wake
us from idle.  That is, there could be a real cpuidle driver for that
chip that does:

cli;
poke ioat;
mwait(ecx = 1);
poke ioat;
sti;

Or we could delete the driver entirely.

--Andy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Getting rid of i7300_idle's idle notifier?
  2015-06-04 23:32 Getting rid of i7300_idle's idle notifier? Andy Lutomirski
@ 2015-06-05  0:31 ` Andy Lutomirski
  2015-06-05  6:52   ` Ingo Molnar
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Lutomirski @ 2015-06-05  0:31 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: Andy Henroid, linux-pm, linux-kernel, Peter Zijlstra, X86 ML,
	Matthew Garrett

On Thu, Jun 4, 2015 at 4:32 PM, Andy Lutomirski <luto@kernel.org> wrote:
> AFAICT the sole purpose for the hideous x86_64 idle_notifier mess is
> to support i7300_idle.  IMO this junk does not belong in IRQ handling,
> etc.  Can we redo this to work in some kind of generic way?
>
> I have no idea why it makes sense to twiddle I/O AT registers in the
> beginning of whatever IRQ wakes up the CPU.
>
> Note that, if absolutely necessary, the ECX bit 0 MWAIT extension can
> be used to reliably execute code before handling interrupts that wake
> us from idle.  That is, there could be a real cpuidle driver for that
> chip that does:
>
> cli;
> poke ioat;
> mwait(ecx = 1);
> poke ioat;
> sti;
>
> Or we could delete the driver entirely.

It's even easier than that.  Just shove the hooks into
acpi_idle_do_entry or similar and remove them from every other
exit_idle call site in the kernel.

--Andy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Getting rid of i7300_idle's idle notifier?
  2015-06-05  0:31 ` Andy Lutomirski
@ 2015-06-05  6:52   ` Ingo Molnar
  2015-06-06 16:06     ` Andy Lutomirski
  0 siblings, 1 reply; 5+ messages in thread
From: Ingo Molnar @ 2015-06-05  6:52 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: Andy Lutomirski, Andy Henroid, linux-pm, linux-kernel,
	Peter Zijlstra, X86 ML, Matthew Garrett


* Andy Lutomirski <luto@amacapital.net> wrote:

> On Thu, Jun 4, 2015 at 4:32 PM, Andy Lutomirski <luto@kernel.org> wrote:
>
> > AFAICT the sole purpose for the hideous x86_64 idle_notifier mess is to 
> > support i7300_idle.  IMO this junk does not belong in IRQ handling, etc.  Can 
> > we redo this to work in some kind of generic way?
> >
> > I have no idea why it makes sense to twiddle I/O AT registers in the beginning 
> > of whatever IRQ wakes up the CPU.
> >
> > Note that, if absolutely necessary, the ECX bit 0 MWAIT extension can be used 
> > to reliably execute code before handling interrupts that wake us from idle.  
> > That is, there could be a real cpuidle driver for that chip that does:
> >
> > cli;
> > poke ioat;
> > mwait(ecx = 1);
> > poke ioat;
> > sti;
> >
> > Or we could delete the driver entirely.
> 
> It's even easier than that.  Just shove the hooks into acpi_idle_do_entry or 
> similar and remove them from every other exit_idle call site in the kernel.

Yes!

Interested in doing a patch?

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Getting rid of i7300_idle's idle notifier?
  2015-06-05  6:52   ` Ingo Molnar
@ 2015-06-06 16:06     ` Andy Lutomirski
  2015-06-30 20:09       ` Len Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Lutomirski @ 2015-06-06 16:06 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Andy Lutomirski, Andy Henroid, linux-pm, linux-kernel,
	Peter Zijlstra, X86 ML, Matthew Garrett

On Thu, Jun 4, 2015 at 11:52 PM, Ingo Molnar <mingo@kernel.org> wrote:
>
> * Andy Lutomirski <luto@amacapital.net> wrote:
>
>> On Thu, Jun 4, 2015 at 4:32 PM, Andy Lutomirski <luto@kernel.org> wrote:
>>
>> > AFAICT the sole purpose for the hideous x86_64 idle_notifier mess is to
>> > support i7300_idle.  IMO this junk does not belong in IRQ handling, etc.  Can
>> > we redo this to work in some kind of generic way?
>> >
>> > I have no idea why it makes sense to twiddle I/O AT registers in the beginning
>> > of whatever IRQ wakes up the CPU.
>> >
>> > Note that, if absolutely necessary, the ECX bit 0 MWAIT extension can be used
>> > to reliably execute code before handling interrupts that wake us from idle.
>> > That is, there could be a real cpuidle driver for that chip that does:
>> >
>> > cli;
>> > poke ioat;
>> > mwait(ecx = 1);
>> > poke ioat;
>> > sti;
>> >
>> > Or we could delete the driver entirely.
>>
>> It's even easier than that.  Just shove the hooks into acpi_idle_do_entry or
>> similar and remove them from every other exit_idle call site in the kernel.
>
> Yes!
>
> Interested in doing a patch?
>

Barely.  I don't have the hardware, I have no idea what the registers
that i7300_idle pokes are for, and I have no particular desire to
start reading the datasheet.  I'm not even really sure that i7300
machines use acpi's processor_idle instead of intel_idle.

I'm happy to give the driver maintainers a few days to respond.  Andy?

--Andy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Getting rid of i7300_idle's idle notifier?
  2015-06-06 16:06     ` Andy Lutomirski
@ 2015-06-30 20:09       ` Len Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Len Brown @ 2015-06-30 20:09 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: Ingo Molnar, Andy Lutomirski, Andy Henroid, linux-pm,
	linux-kernel, Peter Zijlstra, X86 ML, Matthew Garrett

> Barely.  I don't have the hardware, I have no idea what the registers
> that i7300_idle pokes are for, and I have no particular desire to
> start reading the datasheet.  I'm not even really sure that i7300
> machines use acpi's processor_idle instead of intel_idle.
>
> I'm happy to give the driver maintainers a few days to respond.  Andy?

i7300 does not use intel_idle.
it is core2-xeon -- pre-nehalem.

Len Brown, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-06-30 20:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-04 23:32 Getting rid of i7300_idle's idle notifier? Andy Lutomirski
2015-06-05  0:31 ` Andy Lutomirski
2015-06-05  6:52   ` Ingo Molnar
2015-06-06 16:06     ` Andy Lutomirski
2015-06-30 20:09       ` Len Brown

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).