lkml.org 
[lkml]   [2014]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [tip:x86/asm] x86: Speed up ___preempt_schedule*() by using THUNK helpers
On 10/03, Andy Lutomirski wrote:
>
> Is this thing missing a flags or cc clobber:
>
> # define __preempt_schedule() asm ("call ___preempt_schedule")

Well, calling.h says "rflags is clobbered", so probably yes?


> Also, I'm at a loss as to wtf all this code is doing.
>
> There's preempt_schedule, which appears to be a normal C function.
>
> There's ___preempt_schedule, which is written in assembly and calls
> preempt_schedule.
>
> Then there's __preempt_schedule, which is an inline assembler function
> that calls ___preempt_schedule.
>
> Is this all just to make the call sequence for preempt_schedule shorter?

Yes, please look at 1a338ac32ca630f67df25b4a16436cccc314e997

sched, x86: Optimize the preempt_schedule() call

Remove the bloat of the C calling convention out of the
preempt_enable() sites by creating an ASM wrapper which allows us to
do an asm("call ___preempt_schedule") instead.

Oleg.



\
 
 \ /
  Last update: 2014-10-04 02:22    [W:0.139 / U:1.904 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site