Messages in this thread | | | Date | Tue, 21 Dec 2021 09:52:28 +0100 | From | Peter Zijlstra <> | Subject | Re: [PATCH] sched: optimize __cond_resched_lock() |
| |
On Tue, Dec 21, 2021 at 03:23:16PM +0800, xuhaifeng wrote: > if the kernel is preemptible(CONFIG_PREEMPTION=y), schedule()may be > called twice, once via spin_unlock, once via preempt_schedule_common. > > we can add one conditional, check TIF_NEED_RESCHED flag again, > to avoid this.
You can also make it more similar to __cond_resched() instead of making it more different.
| |