Skip to content

x86, mwaitt: introduce AMD mwaitt support

Huang Rui lkml 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest2 patches 3 repliesIn review
  2. v52 patches 8 repliesSuperseded
  3. v42 patches 1 replySuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v32 patches8 repliesSuperseded
v24 patches24 repliesSuperseded
v1 RFC4 patches36 repliesApplied

Changes in v6 from the cover letter

- Move definitions into patch 1
- Completed the power consumption testing both with MWAITX and without MWAITX
- Use mwaitx_delay at bsp_init_amd

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2x86, mwaitt: add monitorx and mwaitx instructionarch/x86/include/asm/cpufeature.h arch/x86/include/asm/mwait.h+44 -00 replies
2/2x86, mwaitt: introduce mwaitx delay with a configurable timerarch/x86/include/asm/delay.h arch/x86/kernel/cpu/amd.c arch/x86/lib/delay.c+52 -12 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v6 yet.

Read the v6 thread

Cover letter [PATCH v6 0/2] x86, mwaitt: introduce AMD mwaitt support

Hi,

This patch set introduces a new instruction support on AMD Carrizo (Family 15h, Model 60h-6fh). It adds mwaitx delay function with a configurable timer.

Andy and Boris provide a suggestion which uses mwaitx on delay method.

As Peter's suggestion of last version (v5), the serial of patch set provides a test result.
http://marc.info/?l=linux-kernel&m=143436586513713&w=2

Some discussions of the background, please see:
http://marc.info/?l=linux-kernel&m=143202042530498&w=2
http://marc.info/?l=linux-kernel&m=143161327003541&w=2
http://marc.info/?l=linux-kernel&m=143222815331016&w=2

Patch set is rebased on tip/master.

Changes from v1 -> v2
- Remove mwaitx idle implementation since some disputes without power improvement.
- Add a patch which implement another use case on delay.
- Introduce a kernel parameter (delay) to make delay method configurable.

Changes from v2 -> v3
- Add compared data on commit message
- Remove kernel parameter
- Add hint to avoid to access deep state in future
- Update mwaitx delay method as Petter's suggestion

Changes from v3 -> v4
- Put the MONITORX/MWAITX description into comments

Changes from v4 -> v5
- Remove mwaitx function
- Use mwaitx_delay at init_amd
- Use cpu_tts as montioring address scope

Changes from v5 -> v6
- Move definitions into patch 1
- Completed the power consumption testing both with MWAITX and without MWAITX
- Use mwaitx_delay at bsp_init_amd

In MWAITX delay, the CPU core will be quiesced in a waiting phase, diminishing its power consumption.

Run a simple test to measure power consumption:

cat /sys/bus/pci/devices/0000\:00\:18.4/hwmon/hwmon0/power1_acc; sleep 10000s;
cat /sys/bus/pci/devices/0000\:00\:18.4/hwmon/hwmon0/power1_acc;

* TSC-based default delay: 485115 uWatts average power
* MWAITX-based delay: 252738 uWatts average power

Thus, that's about 240 milliWatts less power consumption. The test method relies on the support of AMD CPU accumulated power algorithm in fam15_power for which patches are forthcoming.

Thanks,
Rui

Huang Rui (2):
x86, mwaitt: add monitorx and mwaitx instruction x86, mwaitt: introduce mwaitx delay with a configurable timer

 arch/x86/include/asm/cpufeature.h |  1 +
 arch/x86/include/asm/delay.h      |  1 +
 arch/x86/include/asm/mwait.h      | 43 +++++++++++++++++++++++++++++++++++
 arch/x86/kernel/cpu/amd.c         |  4 ++++
 arch/x86/lib/delay.c              | 48 ++++++++++++++++++++++++++++++++++++++-
 5 files changed, 96 insertions(+), 1 deletion(-)
Signature · 1 line
1.9.1