From: tip-bot for Suren Baghdasaryan <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: hpa@zytor.com, nnk@google.com, surenb@google.com,
peterz@infradead.org, tglx@linutronix.de,
linux-kernel@vger.kernel.org, mingo@kernel.org
Subject: [tip:sched/urgent] sched/psi: Do not require setsched permission from the trigger creator
Date: Tue, 6 Aug 2019 04:20:56 -0700 [thread overview]
Message-ID: <tip-04e048cf09d7b5fc995817cdc5ae1acd4482429c@git.kernel.org> (raw)
In-Reply-To: <20190730013310.162367-1-surenb@google.com>
Commit-ID: 04e048cf09d7b5fc995817cdc5ae1acd4482429c
Gitweb: https://git.kernel.org/tip/04e048cf09d7b5fc995817cdc5ae1acd4482429c
Author: Suren Baghdasaryan <surenb@google.com>
AuthorDate: Mon, 29 Jul 2019 18:33:10 -0700
Committer: Peter Zijlstra <peterz@infradead.org>
CommitDate: Tue, 6 Aug 2019 12:49:18 +0200
sched/psi: Do not require setsched permission from the trigger creator
When a process creates a new trigger by writing into /proc/pressure/*
files, permissions to write such a file should be used to determine whether
the process is allowed to do so or not. Current implementation would also
require such a process to have setsched capability. Setting of psi trigger
thread's scheduling policy is an implementation detail and should not be
exposed to the user level. Remove the permission check by using _nocheck
version of the function.
Suggested-by: Nick Kralevich <nnk@google.com>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: lizefan@huawei.com
Cc: mingo@redhat.com
Cc: akpm@linux-foundation.org
Cc: kernel-team@android.com
Cc: dennisszhou@gmail.com
Cc: dennis@kernel.org
Cc: hannes@cmpxchg.org
Cc: axboe@kernel.dk
Link: https://lkml.kernel.org/r/20190730013310.162367-1-surenb@google.com
---
kernel/sched/psi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c
index 7fe2c5fd26b5..23fbbcc414d5 100644
--- a/kernel/sched/psi.c
+++ b/kernel/sched/psi.c
@@ -1061,7 +1061,7 @@ struct psi_trigger *psi_trigger_create(struct psi_group *group,
mutex_unlock(&group->trigger_lock);
return ERR_CAST(kworker);
}
- sched_setscheduler(kworker->task, SCHED_FIFO, ¶m);
+ sched_setscheduler_nocheck(kworker->task, SCHED_FIFO, ¶m);
kthread_init_delayed_work(&group->poll_work,
psi_poll_work);
rcu_assign_pointer(group->poll_kworker, kworker);
prev parent reply other threads:[~2019-08-06 11:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-30 1:33 [PATCH 1/1] psi: do not require setsched permission from the trigger creator Suren Baghdasaryan
2019-07-30 8:11 ` Peter Zijlstra
2019-07-30 17:44 ` Suren Baghdasaryan
2019-08-01 9:51 ` Peter Zijlstra
2019-08-01 18:28 ` Suren Baghdasaryan
2019-08-01 21:59 ` Peter Zijlstra
2019-08-02 1:19 ` Suren Baghdasaryan
2019-08-06 11:20 ` tip-bot for Suren Baghdasaryan [this message]
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=tip-04e048cf09d7b5fc995817cdc5ae1acd4482429c@git.kernel.org \
--to=tipbot@zytor.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=nnk@google.com \
--cc=peterz@infradead.org \
--cc=surenb@google.com \
--cc=tglx@linutronix.de \
/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).