[Mesa-dev] [PATCH 1/2] RFC i965: Bypass a couple of libraries for syscall on x84_64
Eric Engestrom
eric.engestrom at imgtec.com
Mon Jun 19 14:30:46 UTC 2017
On Monday, 2017-06-19 13:02:11 +0100, Chris Wilson wrote:
> 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
I'm confused, if this doesn't improve performances, why reimplement
drmIoctl() in Mesa? Or was the point that you made it `static inline`?
Should your assembly hunk be applied in drmIoctl() in libdrm, maybe?
Cheers,
Eric
More information about the mesa-dev
mailing list