linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kyung Min Park <kyung.min.park@intel.com>
To: x86@kernel.org, linux-kernel@vger.kernel.org
Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
	gregkh@linuxfoundation.org, ak@linux.intel.com,
	tony.luck@intel.com, ashok.raj@intel.com,
	ravi.v.shankar@intel.com, fenghua.yu@intel.com,
	kyung.min.park@intel.com
Subject: [PATCH v4 0/3] x86/delay: Introduce TPAUSE instruction
Date: Fri, 24 Apr 2020 12:37:53 -0700	[thread overview]
Message-ID: <1587757076-30337-1-git-send-email-kyung.min.park@intel.com> (raw)

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 v3 to v4:
  1. Add binutils version to support tpause as suggested by Peter Zijlstra.
  2. Use arch/x86/Kconfig.assembler to set up a CONFIG_AS_TPAUSE
     suggested by Tony Luck.
  3. Fix build issue for make ARCH=i386.

- Change from v2 to v3:
  1. Add Thomas' cleanup patch to this patchset.
  2. Implement use_tpause_delay() to use TPAUSE.
  3. Call use_tpause_delay() during x86_late_time_init().
  4. Use APIs lower_32_bits(), upper_32_bits() as suggested by Joe Perch.
  5. Change __tpause() argument integer type from unsigned int to u32.

- Change from v1 to v2:
  1. Change function/variable names as suggested by Thomas Gleixner 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.
  2. Organize comments to use full width.
  3. Add __ro_after_init for the function pointer delay_halt_fn.
  4. Change patch titles as suggested by Thomas Gleixner.

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

Thomas Gleixner (1):
  x86/delay: Preparatory code cleanup

 arch/x86/Kconfig.assembler   |   4 ++
 arch/x86/include/asm/delay.h |   4 +-
 arch/x86/include/asm/mwait.h |  24 ++++++++-
 arch/x86/kernel/time.c       |   3 ++
 arch/x86/lib/delay.c         | 114 +++++++++++++++++++++++++++++--------------
 5 files changed, 111 insertions(+), 38 deletions(-)

-- 
2.7.4


             reply	other threads:[~2020-04-24 19:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-24 19:37 Kyung Min Park [this message]
2020-04-24 19:37 ` [PATCH v4 1/3] x86/delay: Preparatory code cleanup Kyung Min Park
2020-05-07 14:13   ` [tip: x86/timers] " tip-bot2 for Thomas Gleixner
2020-04-24 19:37 ` [PATCH v4 2/3] x86/delay: Refactor delay_mwaitx() for TPAUSE support Kyung Min Park
2020-05-07 14:13   ` [tip: x86/timers] " tip-bot2 for Kyung Min Park
2020-04-24 19:37 ` [PATCH v4 3/3] x86/delay: Introduce TPAUSE delay Kyung Min Park
2020-05-07 14:13   ` [tip: x86/timers] " tip-bot2 for Kyung Min Park

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1587757076-30337-1-git-send-email-kyung.min.park@intel.com \
    --to=kyung.min.park@intel.com \
    --cc=ak@linux.intel.com \
    --cc=ashok.raj@intel.com \
    --cc=fenghua.yu@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=ravi.v.shankar@intel.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).