Skip to content

sched/psi: Allow unprivileged PSI polling

Domenico Cerasuolo lkml 7 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest4 patches 1 replyIn review
  2. v64 patches 6 repliesApplied
  3. v54 patches 1 replySuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v44 patches5 repliesSuperseded
v34 patches0 repliesSuperseded
v23 patches6 repliesSuperseded
v14 patches8 repliesSuperseded

Changes in v7 from the cover letter

- fix code style in psi trigger create/destroy aggregators paths

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4sched/psi: rearrange polling code in preparationkernel/sched/psi.c+98 -980 replies
2/4sched/psi: rename existing poll members in preparationinclude/linux/psi_types.h kernel/sched/psi.c+100 -990 replies
3/4sched/psi: extract update_triggers side effectkernel/sched/psi.c+10 -90 replies
4/4sched/psi: allow unprivileged polling of N*2s periodDocumentation/accounting/psi.rst include/linux/psi.h include/linux/psi_types.h +2 more+84 -280 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJohannes WeinerSuren Baghdasaryan
SeriesA-b
1/4A-b
2/4A-b
3/4A-b
4/4A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v7 thread

Cover letter [PATCH v7 0/4] sched/psi: Allow unprivileged PSI polling

PSI offers 2 mechanisms to get information about a specific resource pressure. One is reading from /proc/pressure/<resource>, which gives average pressures aggregated every 2s. The other is creating a pollable fd for a specific resource and cgroup.

The trigger creation requires CAP_SYS_RESOURCE, and gives the possibility to pick specific time window and threshold, spawing an RT thread to aggregate the data.

Systemd would like to provide containers the option to monitor pressure on their own cgroup and sub-cgroups. For example, if systemd launches a container that itself then launches services, the container should have the ability to poll() for pressure in individual services. But neither the container nor the services are privileged.

The series is implemented in 4 steps in order to reduce the noise of the change.

V7:
- fix code style in psi trigger create/destroy aggregators paths

V6:
- fix trigger creation logic now using proper locks

V5:
- few suggested code style changes in psi.c and psy_types.h
- fix trigger destruction logic now using proper locks

V4:
- fixed psi_open leftover usage in IRQ accounting (patch 4/4)

V3:
- restored renaming patch (#2 of 4) as suggested in review
- rebased #3 and #4 on the renaming commit

V2:
- removed renaming patch (previous 2/4) and applied suggested solution
- changed update_triggers side effect removal as suggested in review
- rebased core patch on other V2 changes

Domenico Cerasuolo (4):
sched/psi: rearrange polling code in preparation sched/psi: rename existing poll members in preparation sched/psi: extract update_triggers side effect sched/psi: allow unprivileged polling of N*2s period

 Documentation/accounting/psi.rst |   4 +
 include/linux/psi.h              |   2 +-
 include/linux/psi_types.h        |  43 +--
 kernel/cgroup/cgroup.c           |   2 +-
 kernel/sched/psi.c               | 443 +++++++++++++++++--------------
 5 files changed, 276 insertions(+), 218 deletions(-)
Signature · 1 line
2.34.1