lkml.org 
[lkml]   [2013]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC] per-cpu preempt_count
From
On Mon, Aug 12, 2013 at 10:51 AM, H. Peter Anvin <hpa@zytor.com> wrote:
>
> So we would have code looking something like:
>
> decl %fs:preempt_count
> jnz 1f
> cmpb $0,%fs:need_resched
> je 1f
> call __preempt_schedule
> 1:
>
> It's a nontrivial amount of code, but would seem a fair bit better than
> what we have now, at least.

Well, we currently don't even bother checking the preempt count at
all, and we just optimistically assume that we don't nest in the
common case. The preempt count is then re-checked in
__preempt_schedule, I think.

Which sounds like a fair approach.

So the code would be simplified to just

decl %fs:preempt_count
cmpb $0,%fs:need_resched
jne .. unlikely branch that calls __preempt_schedule

which is not horrible. Not *quite* as nice as just doing a single
"decl+js", but hey, certainly better than what we have now.

Linus


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