提交 224980fd 编写于 作者: C Chen Hui 提交者: Ma Wupeng

sched: programmable: Add a tag for the task

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5KUFB
CVE: NA

--------------------------------

Add a tag for the task, useful to identify the special task.
User can use the file system interface to mark different tags for
specific workloads.
The kernel subsystems can use the set_* helpers to mark it too.
The bpf prog obtains the tags to detect different workloads.
Signed-off-by: NChen Hui <judy.chenhui@huawei.com>
Signed-off-by: NRen Zhijie <renzhijie2@huawei.com>
Signed-off-by: NHui Tang <tanghui20@huawei.com>
上级 e0a2b74f
......@@ -1416,7 +1416,12 @@ struct task_struct {
KABI_RESERVE(4)
KABI_RESERVE(5)
#endif
#ifdef CONFIG_BPF_SCHED
/* Used to pad the tag of a task */
KABI_USE(6, long tag)
#else
KABI_RESERVE(6)
#endif
KABI_RESERVE(7)
KABI_RESERVE(8)
KABI_RESERVE(9)
......
......@@ -216,6 +216,9 @@ struct task_struct init_task
#endif
#ifdef CONFIG_SECCOMP_FILTER
.seccomp = { .filter_count = ATOMIC_INIT(0) },
#endif
#ifdef CONFIG_BPF_SCHED
.tag = 0,
#endif
._resvd = &init_task_struct_resvd,
};
......
......@@ -3477,6 +3477,9 @@ static void __sched_fork(unsigned long clone_flags, struct task_struct *p)
#ifdef CONFIG_SMP
p->wake_entry.u_flags = CSD_TYPE_TTWU;
#endif
#ifdef CONFIG_BPF_SCHED
p->tag = 0;
#endif
}
DEFINE_STATIC_KEY_FALSE(sched_numa_balancing);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册