lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250721124104.806120-1-quic_zhonhan@quicinc.com>
Date: Mon, 21 Jul 2025 20:40:59 +0800
From: Zhongqiu Han <quic_zhonhan@...cinc.com>
To: <rafael@...nel.org>, <lenb@...nel.org>, <pavel@...nel.org>,
        <tony.luck@...el.com>, <reinette.chatre@...el.com>,
        <Dave.Martin@....com>, <james.morse@....com>, <ulf.hansson@...aro.org>,
        <amit.kucheria@...aro.org>, <christian.loehle@....com>
CC: <linux-pm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <quic_zhonhan@...cinc.com>
Subject: [PATCH v2 0/5] PM QoS: Add CPU affinity latency QoS support and resctrl integration

Hi all,

This patch series introduces support for CPU affinity-based latency
constraints in the PM QoS framework. The motivation is to allow
finer-grained power management by enabling latency QoS requests to target
specific CPUs, rather than applying system-wide constraints.

The current PM QoS framework supports global and per-device CPU latency
constraints. However, in many real-world scenarios, such as IRQ affinity
or CPU-bound kernel threads, only a subset of CPUs are
performance-critical. Applying global constraints in such cases
unnecessarily prevents other CPUs from entering deeper C-states, leading
to increased power consumption.

This series addresses that limitation by introducing a new interface that
allows latency constraints to be applied to a CPU mask. This is
particularly useful on heterogeneous platforms (e.g., big.LITTLE) and
embedded systems where power efficiency is critical for example:

                        driver A       rt kthread B      module C
  CPU IDs (mask):         0-3              2-5              6-7
  target latency(us):     20               30               100
                          |                |                |
                          v                v                v
                          +---------------------------------+
                          |        PM  QoS  Framework       |
                          +---------------------------------+
                          |                |                |
                          v                v                v
  CPU IDs (mask):        0-3            2-3,4-5            6-7
  runtime latency(us):   20             20, 30             100

The current implementation includes only cpu_affinity_latency_qos_add()
and cpu_affinity_latency_qos_remove() interfaces. An update interface is
planned for future submission, along with PM QoS optimizations in the UFS
subsystem.

Patch1 introduces the core support for CPU affinity latency QoS in the PM
QoS framework.

Patch2 removes redundant KERN_ERR prefixes in WARN() calls in the global
CPU PM QoS interface. This change addresses issues in existing code and is
not related to the new interface introduced in this patch series.

Patch3 adds documentation for the new interface.

Patch4 fixes a minor documentation issue related to the return type of
cpu_latency_qos_request_active(). This change addresses issues in existing
doc and is not related to the new interface introduced in this patch
series.

Patch5 updates the resctrl pseudo-locking logic to use the new CPU
affinity latency QoS helpers, improving clarity and consistency. The only
functional and beneficial change is that the new interface actively wakes
up CPUs whose latency QoS values have changed, ensuring the latency limit
takes effect immediately.

Changes since v1:
- Rebased on top of current next.
- Resolve the compilation warning due to a missing static function
  declaration.
- Remove the conditional compilation based on CONFIG_CPU_IDLE and make it
  depend solely on CONFIG_PM.
- Add support for cpu_affinity_latency_qos_active.
- Remove cpu_affinity_latency_qos_update; will reintroduce it when needed
  in the future.
- Optimize the code, for example by using cpu_affinity_latency_qos_active
  inside the add/remove functions to enhance robustness.
- Refine the commit message and fix a few minor issues unrelated to this
  series.
- Refactor the CPU latency PM QoS logic of resctrl pseudo_lock using the
  interfaces provided by this series.
- Link to v1: https://lore.kernel.org/all/20250424095228.1112558-1-quic_zhonhan@quicinc.com/

Zhongqiu Han (5):
  PM: QoS: Add support for CPU affinity latency PM QoS
  PM: QOS: Remove unnecessary KERN_ERR on WARN() calls
  Documentation: PM: QoS: Add CPU affinity latency PM QoS Interface
    documentation
  Documentation: PM: QoS: Fix return type and return value description
  resctrl: Replace PM QoS logic with cpu_affinity_latency_qos_* helpers

 Documentation/power/pm_qos_interface.rst |  63 ++++++++-
 fs/resctrl/pseudo_lock.c                 |  51 +------
 include/linux/pm_qos.h                   |  40 ++++++
 include/linux/resctrl.h                  |   3 +-
 kernel/power/qos.c                       | 166 ++++++++++++++++++++++-
 5 files changed, 268 insertions(+), 55 deletions(-)


base-commit: 024e09e444bd2b06aee9d1f3fe7b313c7a2df1bb
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ