[Mesa-dev] [PATCH 1/2] RFC i965: Bypass a couple of libraries for syscall on x84_64

Chris Wilson chris at chris-wilson.co.uk
Mon Jun 19 12:02:11 UTC 2017


Quoting Emil Velikov (2017-06-19 12:43:42)
> Hi Chris,
> 
> On 19 June 2017 at 12:32, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> > On linux/x86_64, calling into the kernel is just a single instruction
> > with the parameters passed via registers. We can therefre shortcircuit a
> > couple of library indirections around ioctl() which as much as the
> > switch into the kernel itself. Aside from the PLT indirection, libc's
> > ioctl() has a slight impedance mismatch with the kernel interface in
> > that it converts the -errno return into -1 + errno, which we immediately
> > convert back into -errno for ourselves!
> >
> Did you measure any performance difference with this patch/series?
> If so, please include the numbers in the commit message.

Realistically you are not going to observe any performance improvement.
The only time when there is non-negligible time inside the drmIoct/ioctl
library functions is when the client is doing a busy-spin waiting for
results from the GPU. All this is doing is removing some junk from the
profiler -- it looks impressive in perf, but since it was GPU bound in
the first place making the busy-spinner faster is uneventful.

Just a cosmetic improvement, but quite straightforward.
-Chris


More information about the mesa-dev mailing list