2020-03-20 04:15:13

by Kyung Min Park

[permalink] [raw]
Subject: [PATCH v2 0/2] x86/delay: Introduce TPAUSE instruction

Intel processors that support the WAITPKG feature implement
the TPAUSE instruction that suspends execution in a lower power
state until the TSC (Time Stamp Counter) exceeds a certain value.

Update the udelay() function to use TPAUSE on systems where it
is available. Note that we hard code the deeper (C0.2) sleep
state because exit latency is small compared to the "microseconds"
that usleep() will delay.

ChangeLog:
- Change from v1 to v2:
1. The patchset applies after Thomas's cleanup patch as below:
https://lkml.org/lkml/diff/2020/3/18/893/1
2. Change function/variable names as suggested by Thomas i.e.
a. Change to delay_halt_fn/delay_halt_mwaitx/delay_halt_tpause from
wait_func/mwaitx/tpause.
b. Change variable name loops to cycles.
c. Change back to the original name delay_fn from delay_platform.
3. Organize comments to use full width.
4. Add __ro_after_init for the function pointer delay_halt_fn.
5. Change patch titles as suggested by Thomas.

Kyung Min Park (2):
x86/delay: Refactor delay_mwaitx() for TPAUSE support
x86/delay: Introduce TPAUSE delay

arch/x86/include/asm/mwait.h | 17 ++++++++++
arch/x86/lib/delay.c | 75 +++++++++++++++++++++++++++++++++-----------
2 files changed, 73 insertions(+), 19 deletions(-)

--
2.7.4


2020-03-20 09:59:37

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [PATCH v2 0/2] x86/delay: Introduce TPAUSE instruction

Hi!

Kyung Min Park <[email protected]> writes:

> Intel processors that support the WAITPKG feature implement
> the TPAUSE instruction that suspends execution in a lower power
> state until the TSC (Time Stamp Counter) exceeds a certain value.
>
> Update the udelay() function to use TPAUSE on systems where it
> is available. Note that we hard code the deeper (C0.2) sleep
> state because exit latency is small compared to the "microseconds"
> that usleep() will delay.
>
> ChangeLog:
> - Change from v1 to v2:
> 1. The patchset applies after Thomas's cleanup patch as below:
> https://lkml.org/lkml/diff/2020/3/18/893/1

lkml.org is horrible. Please use lore.kernel.org if at all.

Also please just add the patch to the series when posting so that people
don't have to go through loops and hoops to grab that dependency.

Thanks,

tglx


2020-03-20 23:44:40

by Kyung Min Park

[permalink] [raw]
Subject: RE: [PATCH v2 0/2] x86/delay: Introduce TPAUSE instruction

Hi Thomas,

> -----Original Message-----
> From: Thomas Gleixner <[email protected]>
> Sent: Friday, March 20, 2020 2:57 AM
> To: Park, Kyung Min <[email protected]>; [email protected]; linux-
> [email protected]
> Cc: [email protected]; [email protected]; [email protected];
> [email protected]; Luck, Tony <[email protected]>; Raj, Ashok
> <[email protected]>; Shankar, Ravi V <[email protected]>; Yu,
> Fenghua <[email protected]>; Park, Kyung Min
> <[email protected]>
> Subject: Re: [PATCH v2 0/2] x86/delay: Introduce TPAUSE instruction
>
> Hi!
>
> Kyung Min Park <[email protected]> writes:
>
> > Intel processors that support the WAITPKG feature implement the TPAUSE
> > instruction that suspends execution in a lower power state until the
> > TSC (Time Stamp Counter) exceeds a certain value.
> >
> > Update the udelay() function to use TPAUSE on systems where it is
> > available. Note that we hard code the deeper (C0.2) sleep state
> > because exit latency is small compared to the "microseconds"
> > that usleep() will delay.
> >
> > ChangeLog:
> > - Change from v1 to v2:
> > 1. The patchset applies after Thomas's cleanup patch as below:
> > https://lkml.org/lkml/diff/2020/3/18/893/1
>
> lkml.org is horrible. Please use lore.kernel.org if at all.

Let me change in the next patch.

> Also please just add the patch to the series when posting so that people don't
> have to go through loops and hoops to grab that dependency.

Sure, Let me add this patch to the series.

> Thanks,
>
> tglx
>