lkml.org 
[lkml]   [2014]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] sched: Fix lost reschedule in __cond_resched()
From
On Sun, Dec 14, 2014 at 10:04 AM, Frederic Weisbecker
<fweisbec@gmail.com> wrote:
>
> Such as:

So I like your patch, but quite frankly, can we go one step further?

Look at the callers of __schedule().

EVERY SINGLE ONE now has that loop around it that goes along the lines of

do {
.. disable preemption somehow ..
__schedule();
...enable preemption without scheduling ..
} while (need_resced());

except for one - the regular "schedule()" function.

Furthermore, look inside __schedule() itself: it has the same loop,
except with a count of one.

So I would suggest going the extra mile, and
- remove the loop from __schedule() itself
- add the same loop as everywhere else to "schedule()"

IOW, just make this "you have to loop and disable preemption" thing be
a rule that __schedule() can depend on.

Linus


\
 
 \ /
  Last update: 2014-12-14 21:21    [W:0.232 / U:1.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site