lkml.org 
[lkml]   [2015]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 2/4] x86, mwaitt: introduce mwaitx idle with a configurable timer
On Wed, 20 May 2015, Borislav Petkov wrote:

> On Wed, May 20, 2015 at 04:55:58PM +0100, One Thousand Gnomes wrote:
> > > That's not what appears to be happening here though: the MWAITX will
> > > return after the timeout.
> > >
> > > Which isn't really useful unless we use it to drive timers.
> >
> > What about things like mdelay() ?
>
> It has an upper limit on the max timeout though: u32 TSC cycles.

Which would be good enough for mdelay/udelay I think, but we'd need to
measure the time spend in MWAITT so we wont return early.

Something like this:

delay = usec_to_tsc(delay);
end = rdtsc() + delay;
while (1) {
MWAITT(delay);
now = rdtsc();
if (end <= now)
break;
delay = end - now;
}

Now we'd need to add alternatives or some other mechanism to it to
make this conditionally for those machines.

Not sure if it's worth the trouble.

Thanks,

tglx


\
 
 \ /
  Last update: 2015-05-20 21:41    [W:2.100 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site