lkml.org 
[lkml]   [2015]   [May]   [21]   [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 Thu, May 21, 2015 at 04:15:54AM +0800, Borislav Petkov wrote:
> On Wed, May 20, 2015 at 09:12:15PM +0200, Thomas Gleixner wrote:
> > 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:
>
> Yeah, with a check maybe:
>
> > delay = usec_to_tsc(delay_usec);
>
> if (delay > ((1 << 32) - 1)) {
> mdelay(delay_usec);
> return;
> }
>
> > end = rdtsc() + delay;
> > while (1) {
>
> I guess
> monitorx( ...);
>
> first.
>
> > 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.
>
> alternative_call(mdelay, mdelayx, X86_FEATURE_MWAITT, /* no output */, timeout);
>
> Something like that maybe.
>
> > Not sure if it's worth the trouble.
>
> Could be a use case for MWAITX in the kernel!
>

Looks like good use case. Boris, could we try to implement it?

Thanks,
Rui


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