Messages in this thread | | | From | Linus Torvalds <> | Date | Tue, 23 Apr 2019 13:27:29 -0700 | Subject | Re: [PATCH] bpf: Fix preempt_enable_no_resched() abuse |
| |
On Tue, Apr 23, 2019 at 12:56 PM Peter Zijlstra <peterz@infradead.org> wrote: > > Unless the very next line is schedule(), or implies it, one must not use > preempt_enable_no_resched(). It can cause a preemption to go missing and > thereby cause arbitrary delays, breaking the PREEMPT=y invariant.
That language may be a bit strong, or m,aybe the "implies it" might at least be extended on.
It doesn't need to be "schedule()" per se, it can be any of the things that check if we _need_ to be scheduled.
IOW, various variations of "if (need_resched())" exiting a loop, and then outside the loop there's a cond_resched() or similar.
Linus
| |