lkml.org 
[lkml]   [2013]   [Dec]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] speeding up the stat() family of system calls...
On 12/26/2013 11:00 AM, Linus Torvalds wrote:
>
> Interestingly, looking at the cp_new_stat() profiles, the games we
> play to get efficient range checking seem to actually hurt us. Maybe
> it's the "sbb" that is just expensive, or maybe it's turning a (very
> predictable) conditional branch into a data dependency chain instead.
> Or maybe it's just random noise in my profiles that happened to make
> those sbb's look bad.
>

I'm not at all surprised... there is a pretty serious data dependency
chain here and in the end we end up manifesting a value in a register
that has to be tested even though it is available in the flags. Inline
assembly also means the compiler can't optimize it at all.

I have to wonder if we actually have to test the upper limit, though: we
can always guarantee a guard zone between user space and kernel space,
and thus guarantee either a #PF or #GP if someone tries to overflow user
space. Testing just the lower limit would be much cheaper, especially
on 64 bits where we can simply test the sign bit.

What do you think?

-hpa



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