mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Domenico Cerasuolo <cerasuolodomenico@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: peterz@infradead.org, surenb@google.com, brauner@kernel.org,
	chris@chrisdown.name, hannes@cmpxchg.org,
	Domenico Cerasuolo <cerasuolodomenico@gmail.com>
Subject: [PATCH v3 0/4] sched/psi: Allow unprivileged PSI polling
Date: Wed, 29 Mar 2023 09:48:38 +0200	[thread overview]
Message-ID: <20230329074842.16209-1-cerasuolodomenico@gmail.com> (raw)

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.

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               | 432 +++++++++++++++++--------------
 5 files changed, 262 insertions(+), 221 deletions(-)

-- 
2.34.1


             reply	other threads:[~2023-03-29  7:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-29  7:48 Domenico Cerasuolo [this message]
2023-03-29  7:48 ` [PATCH v3 1/4] sched/psi: rearrange polling code in preparation Domenico Cerasuolo
2023-03-29  7:48 ` [PATCH v3 2/4] sched/psi: rename existing poll members " Domenico Cerasuolo
2023-03-29  7:48 ` [PATCH v3 3/4] sched/psi: extract update_triggers side effect Domenico Cerasuolo
2023-03-29  7:48 ` [PATCH v3 4/4] sched/psi: allow unprivileged polling of N*2s period Domenico Cerasuolo
2023-03-29 13:36   ` kernel test robot
2023-03-29 14:17   ` kernel test robot

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=20230329074842.16209-1-cerasuolodomenico@gmail.com \
    --to=cerasuolodomenico@gmail.com \
    --cc=brauner@kernel.org \
    --cc=chris@chrisdown.name \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=surenb@google.com \
    /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

all inboxes | Powered by JetHome®