From: K Prateek Nayak <kprateek.nayak@amd.com>
To: <linux-kernel@vger.kernel.org>
Cc: <aubrey.li@linux.intel.com>, <efault@gmx.de>,
<gautham.shenoy@amd.com>, <libo.chen@oracle.com>,
<mgorman@techsingularity.net>, <mingo@kernel.org>,
<peterz@infradead.org>, <song.bao.hua@hisilicon.com>,
<srikar@linux.vnet.ibm.com>, <tglx@linutronix.de>,
<valentin.schneider@arm.com>, <vincent.guittot@linaro.org>,
<wuyun.abel@bytedance.com>, <wyes.karny@amd.com>,
<yu.c.chen@intel.com>, <yangyicong@huawei.com>
Subject: [PATCH 1/5] task_struct: Add field for per-task userspace scheduler hint
Date: Sat, 10 Sep 2022 16:23:22 +0530 [thread overview]
Message-ID: <20220910105326.1797-2-kprateek.nayak@amd.com> (raw)
In-Reply-To: <20220910105326.1797-1-kprateek.nayak@amd.com>
- Add a field named "hint" to store the per-task userspace scheduler
hint set via the prctl() interface.
- Hints are inherited from parent on fork. Inherited hints can be reset
from the same prctl() interface used to set hint to default or any
other value.
- Hints are best effort case and scheduler doesn't make any guarantees
of strictly adhering to it.
Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
---
include/linux/sched.h | 1 +
init/init_task.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index e7b2f8a5c711..fc953c9e956a 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -769,6 +769,7 @@ struct task_struct {
int wake_cpu;
#endif
int on_rq;
+ unsigned int hint;
int prio;
int static_prio;
diff --git a/init/init_task.c b/init/init_task.c
index ff6c4b9bfe6b..f5208e6a1934 100644
--- a/init/init_task.c
+++ b/init/init_task.c
@@ -79,6 +79,7 @@ struct task_struct init_task
.static_prio = MAX_PRIO - 20,
.normal_prio = MAX_PRIO - 20,
.policy = SCHED_NORMAL,
+ .hint = 0,
.cpus_ptr = &init_task.cpus_mask,
.user_cpus_ptr = NULL,
.cpus_mask = CPU_MASK_ALL,
--
2.25.1
next prev parent reply other threads:[~2022-09-10 10:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-10 10:53 [RFC PATCH 0/5] sched: Userspace Hinting for Task Placement K Prateek Nayak
2022-09-10 10:53 ` K Prateek Nayak [this message]
2022-09-10 10:53 ` [PATCH 2/5] prctl: Add interface and helper functions to set hints K Prateek Nayak
2022-09-10 10:53 ` [PATCH 3/5] sched/fair: Add support for hints in the subsequent wakeup path K Prateek Nayak
2022-09-10 10:53 ` [PATCH 4/5] sched/fair: Consider hints in the initial task " K Prateek Nayak
2022-09-10 10:53 ` [PATCH 5/5] sched/fair: Add exception for hints in load balancing path K Prateek Nayak
[not found] ` <20220911080547.2709-1-hdanton@sina.com>
2022-09-12 6:29 ` K Prateek Nayak
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=20220910105326.1797-2-kprateek.nayak@amd.com \
--to=kprateek.nayak@amd.com \
--cc=aubrey.li@linux.intel.com \
--cc=efault@gmx.de \
--cc=gautham.shenoy@amd.com \
--cc=libo.chen@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@techsingularity.net \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=song.bao.hua@hisilicon.com \
--cc=srikar@linux.vnet.ibm.com \
--cc=tglx@linutronix.de \
--cc=valentin.schneider@arm.com \
--cc=vincent.guittot@linaro.org \
--cc=wuyun.abel@bytedance.com \
--cc=wyes.karny@amd.com \
--cc=yangyicong@huawei.com \
--cc=yu.c.chen@intel.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®