lkml.org 
[lkml]   [2019]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] bpf: Fix preempt_enable_no_resched() abuse
On Tue, Apr 23, 2019 at 10:35:12PM +0200, Peter Zijlstra wrote:
> On Tue, Apr 23, 2019 at 01:27:29PM -0700, Linus Torvalds wrote:
> > 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.
>
> I'll try and word-smith that tomorrow, brain is fried. But yes,
> something that ends up in schedule() 'soon'.

I've made that:

Unless there is a call into schedule() in the immediate
(deterministic) future, 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.

\
 
 \ /
  Last update: 2019-04-24 15:21    [W:0.095 / U:0.656 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site