All of lore.kernel.org
 help / color / mirror / Atom feed
* sched: Remove pointless preemption disable in sched_submit_work()
@ 2021-09-28 14:30 Thomas Gleixner
  2021-09-28 14:41 ` Jens Axboe
  2021-09-29  1:26 ` Lai Jiangshan
  0 siblings, 2 replies; 6+ messages in thread
From: Thomas Gleixner @ 2021-09-28 14:30 UTC (permalink / raw)
  To: LKML; +Cc: Peter Zijlstra, Ingo Molnar, Peter Oskolkov, Tejun Heo,
	Jens Axboe

Neither wq_worker_sleeping() nor io_wq_worker_sleeping() require to be invoked
with preemption disabled:

  - The worker flag checks operations only need to be serialized against
    the worker thread itself.

  - The accounting and worker pool operations are serialized with locks.

which means that disabling preemption has neither a reason nor a
value. Remove it.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/sched/core.c |    2 --
 1 file changed, 2 deletions(-)

--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6327,12 +6327,10 @@ static inline void sched_submit_work(str
 	 * requires it.
 	 */
 	if (task_flags & (PF_WQ_WORKER | PF_IO_WORKER)) {
-		preempt_disable();
 		if (task_flags & PF_WQ_WORKER)
 			wq_worker_sleeping(tsk);
 		else
 			io_wq_worker_sleeping(tsk);
-		preempt_enable_no_resched();
 	}
 
 	if (tsk_is_pi_blocked(tsk))

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

end of thread, other threads:[~2021-10-05 14:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-28 14:30 sched: Remove pointless preemption disable in sched_submit_work() Thomas Gleixner
2021-09-28 14:41 ` Jens Axboe
2021-09-29  1:26 ` Lai Jiangshan
2021-09-29  9:37   ` [PATCH v2] " Thomas Gleixner
2021-10-01 15:05     ` [tip: sched/core] " tip-bot2 for Thomas Gleixner
2021-10-05 14:11     ` tip-bot2 for Thomas Gleixner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.