Re: [ABOMINATION] x86: Fast interrupt return to userspace

From: Linus Torvalds
Date: Tue May 06 2014 - 17:40:53 EST


On Tue, May 6, 2014 at 2:25 PM, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> Whatever. I got enough profile data to say that it seems to have cut
> 'iret' overhead by at least two thirds. So it may not *work*, but from
> a "hey look, some random numbers" standpoint it is worth playing with.

Just to clarify: that's just the "iret" part. On both the kernel build
and my microbenchmark, the fault itself is the more expensive part.

But on my microbenchmark, it used to be 80% page fault overhead, where
the split was roughly 55/25 percentage points. So the cost of "iret"
was almost a third of the total page fault cost, and roughly a quarter
of the total cost on that microbeanchmark.

And remember: that microbenchmark improved absolute performance by
about 23%. That already implied that most of iret just went away. The
(partial) profile numbers I did get before the machine hung seem to
back that up, with the page fault overhead now looking like 67% of
total (but remember: it's a smaller total, so the real improvement is
bigger than that 80% -> 67% thing), with the percentage point split
being roughly 64/3. So with that sysret trick, the 'iret" overhead is
pretty much negligible - it went from a third of the page fault cost
to 1/20th or so.

But the fault itself obviously doesn't speed up.

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/