public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH sched_ext/for-6.11] sched_ext: Reverting @p->sched_class if @p->disallow is set
@ 2024-07-11 11:07 Zhangqiao (2012 lab)
  2024-07-11 18:57 ` Tejun Heo
  0 siblings, 1 reply; 12+ messages in thread
From: Zhangqiao (2012 lab) @ 2024-07-11 11:07 UTC (permalink / raw)
  To: tj, void; +Cc: linux-kernel

From: Zhang Qiao <zhangqiao22@huawei.com>

when ops.init_task() sets @p->disallow, @p->policy was
reverted to @SCHED_NORMAL, but @p->sched_class was not,
so reverting p->sched_class to fair_sched_classs now.

Signed-off-by: Zhang Qiao <zhangqiao22@huawei.com>
---
 kernel/sched/ext.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index ae9ec8f..fb83edd 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -3220,13 +3220,14 @@ static int scx_ops_init_task(struct task_struct *p, struct task_group *tg, bool
 
 		/*
 		 * We're either in fork or load path and @p->policy will be
-		 * applied right after. Reverting @p->policy here and rejecting
-		 * %SCHED_EXT transitions from scx_check_setscheduler()
+		 * applied right after. Reverting @p->policy and @p->sched_class
+		 * here and rejecting %SCHED_EXT transitions from scx_check_setscheduler()
 		 * guarantees that if ops.init_task() sets @p->disallow, @p can
 		 * never be in SCX.
 		 */
 		if (p->policy == SCHED_EXT) {
 			p->policy = SCHED_NORMAL;
+			p->sched_class = &fair_sched_class;
 			atomic_long_inc(&scx_nr_rejected);
 		}
 
-- 
2.45.2.windows.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-08-02 18:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-11 11:07 [PATCH sched_ext/for-6.11] sched_ext: Reverting @p->sched_class if @p->disallow is set Zhangqiao (2012 lab)
2024-07-11 18:57 ` Tejun Heo
2024-07-16 11:32   ` Zhangqiao (2012 lab)
2024-07-16 20:48     ` Tejun Heo
2024-07-17  2:01       ` Zhangqiao (2012 lab)
2024-07-17 17:49         ` Tejun Heo
2024-07-18  6:04           ` Zhangqiao (2012 lab)
2024-07-31 19:14             ` [PATCH sched_ext/for-6.12] sched_ext: Allow p->scx.disallow only while loading Tejun Heo
2024-07-31 20:33               ` David Vernet
2024-08-01 23:32                 ` [PATCH v2 " Tejun Heo
2024-08-02  0:21                   ` David Vernet
2024-08-02 18:59                   ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox