From: Chris Down <chris@chrisdown.name>
To: Suren Baghdasaryan <surenb@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
Peter Zijlstra <peterz@infradead.org>,
linux-kernel@vger.kernel.org
Subject: PSI poll() support for unprivileged users
Date: Fri, 24 Apr 2020 16:38:59 +0100 [thread overview]
Message-ID: <20200424153859.GA1481119@chrisdown.name> (raw)
Hi Suren,
I noticed that one restriction of the PSI poll() interface is that currently
only root can set up new triggers. Talking to Johannes, it seems the reason for
this was that you end up with a realtime kernel thread for every cgroup where a
trigger is set, and this could be used by unprivileged users to sap resources.
I'm building a userspace daemon for desktop users which notifies based on
pressure events, and it's particularly janky to ask people to run such a
notifier as root: the notification mechanism is usually tied to the user's
display server auth, and the surrounding environment is generally pretty
important to maintain. In addition to this, just in general this doesn't feel
like the kind of feature that by its nature needs to be restricted to root --
it seems reasonable that there would be unprivileged users which want to use
this, and that not using RT threads would be acceptable in that scenario.
Have you considered making the per-cgroup RT threads optional? If the
processing isn't done in the FIFO kthread for unprivileged users, I think it
should be safe to allow them to write to pressure files (perhaps with some
additional limits or restrictions on things like the interval, as needed).
Thanks!
Chris
next reply other threads:[~2020-04-24 15:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-24 15:38 Chris Down [this message]
2020-04-24 19:43 ` PSI poll() support for unprivileged users Suren Baghdasaryan
2020-04-24 22:46 ` Suren Baghdasaryan
2020-04-28 11:34 ` Chris Down
2020-04-28 18:28 ` Suren Baghdasaryan
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=20200424153859.GA1481119@chrisdown.name \
--to=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;
as well as URLs for NNTP newsgroup(s).