Re: [PATCH v3 2/2] x86, mwaitt: introduce mwaix delay with a configurable timer

2015-06-12 Thread Huang Rui
On Fri, Jun 12, 2015 at 10:30:33AM +0200, Borislav Petkov wrote: > On Fri, Jun 12, 2015 at 03:50:33PM +0800, Huang Rui wrote: > > Yeah, but I remembered at last time, someone tell me we shouldn't > > force to set timer always enabled. So I add this interface to expose > > more clearly. :) > > Yeah

Re: [PATCH v3 2/2] x86, mwaitt: introduce mwaix delay with a configurable timer

2015-06-12 Thread Borislav Petkov
On Fri, Jun 12, 2015 at 03:50:33PM +0800, Huang Rui wrote: > Yeah, but I remembered at last time, someone tell me we shouldn't > force to set timer always enabled. So I add this interface to expose > more clearly. :) Yeah, but this interface would make users go and look at it and try to remember w

Re: [PATCH v3 2/2] x86, mwaitt: introduce mwaix delay with a configurable timer

2015-06-12 Thread Huang Rui
On Fri, Jun 12, 2015 at 09:38:48AM +0200, Peter Zijlstra wrote: > On Fri, Jun 12, 2015 at 12:03:22PM +0800, Huang Rui wrote: > > > > What's the purpose of the "enable" parameter? > > > > > > > Enable mwaitx timer. Should I add comments to explain the usage? > > No, you should read your own patc

Re: [PATCH v3 2/2] x86, mwaitt: introduce mwaix delay with a configurable timer

2015-06-12 Thread Peter Zijlstra
On Fri, Jun 12, 2015 at 12:03:22PM +0800, Huang Rui wrote: > > What's the purpose of the "enable" parameter? > > > > Enable mwaitx timer. Should I add comments to explain the usage? No, you should read your own patch, notice that the only usage site provides a true, then realize its a redundant

Re: [PATCH v3 2/2] x86, mwaitt: introduce mwaix delay with a configurable timer

2015-06-11 Thread Huang Rui
On Thu, Jun 11, 2015 at 10:34:15AM -0700, Andy Lutomirski wrote: > On Thu, Jun 11, 2015 at 7:14 AM, Huang Rui wrote: > > MWAITX can enable a timer and a corresponding timer value specified in SW > > P0 clocks. The SW P0 frequency is the same with TSC. The timer provides an > > upper bound on how l

Re: [PATCH v3 2/2] x86, mwaitt: introduce mwaix delay with a configurable timer

2015-06-11 Thread Andy Lutomirski
On Thu, Jun 11, 2015 at 7:14 AM, Huang Rui wrote: > MWAITX can enable a timer and a corresponding timer value specified in SW > P0 clocks. The SW P0 frequency is the same with TSC. The timer provides an > upper bound on how long the instruction waits before exiting. > > The implementation of delay

[PATCH v3 2/2] x86, mwaitt: introduce mwaix delay with a configurable timer

2015-06-11 Thread Huang Rui
MWAITX can enable a timer and a corresponding timer value specified in SW P0 clocks. The SW P0 frequency is the same with TSC. The timer provides an upper bound on how long the instruction waits before exiting. The implementation of delay function in kernel can lerverage the timer of MWAITX. This