[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150520201553.GI3645@pd.tnic>
Date:	Wed, 20 May 2015 22:15:54 +0200
From:	Borislav Petkov <bp@...e.de>
To:	Thomas Gleixner <tglx@...utronix.de>
Cc:	One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>,
	Ingo Molnar <mingo@...nel.org>, Huang Rui <ray.huang@....com>,
	Len Brown <lenb@...nel.org>,
	"Rafael J. Wysocki" <rjw@...ysocki.net>, x86@...nel.org,
	linux-kernel@...r.kernel.org,
	Fengguang Wu <fengguang.wu@...el.com>,
	Aaron Lu <aaron.lu@...el.com>, Tony Li <tony.li@....com>,
	Frédéric Weisbecker <fweisbec@...il.com>
Subject: Re: [RFC PATCH 2/4] x86, mwaitt: introduce mwaitx idle with a
 configurable timer
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!
:-D
-- 
Regards/Gruss,
    Boris.
ECO tip #101: Trim your mails when you reply.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Powered by blists - more mailing lists
 
