mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2025-11-07 21:30:56 +00:00
sched: Remove pointless preemption disable in sched_submit_work()
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 and update the stale comment.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Lai Jiangshan <jiangshanlai@gmail.com>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Link: https://lkml.kernel.org/r/8735pnafj7.ffs@tglx
This commit is contained in:
parent
670721c7bd
commit
b945efcdd0
@ -6251,20 +6251,14 @@ static inline void sched_submit_work(struct task_struct *tsk)
|
|||||||
|
|
||||||
task_flags = tsk->flags;
|
task_flags = tsk->flags;
|
||||||
/*
|
/*
|
||||||
* If a worker went to sleep, notify and ask workqueue whether
|
* If a worker goes to sleep, notify and ask workqueue whether it
|
||||||
* it wants to wake up a task to maintain concurrency.
|
* wants to wake up a task to maintain concurrency.
|
||||||
* As this function is called inside the schedule() context,
|
|
||||||
* we disable preemption to avoid it calling schedule() again
|
|
||||||
* in the possible wakeup of a kworker and because wq_worker_sleeping()
|
|
||||||
* requires it.
|
|
||||||
*/
|
*/
|
||||||
if (task_flags & (PF_WQ_WORKER | PF_IO_WORKER)) {
|
if (task_flags & (PF_WQ_WORKER | PF_IO_WORKER)) {
|
||||||
preempt_disable();
|
|
||||||
if (task_flags & PF_WQ_WORKER)
|
if (task_flags & PF_WQ_WORKER)
|
||||||
wq_worker_sleeping(tsk);
|
wq_worker_sleeping(tsk);
|
||||||
else
|
else
|
||||||
io_wq_worker_sleeping(tsk);
|
io_wq_worker_sleeping(tsk);
|
||||||
preempt_enable_no_resched();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tsk_is_pi_blocked(tsk))
|
if (tsk_is_pi_blocked(tsk))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user