x86: introduce and use percpu_inc()
Quoted 7 lines
Quoted 1 line
Quoted 1 line
"H. Peter Anvin" 04/21/10 7:57 PM >>>
Quoted 3 lines · Jan Beulich
... generating slightly smaller code.
Signed-off-by Jan BeulichHow much smaller?
The percpu_add(..., 1) -> percpu_inc() conversion is just a single byte reduction (the immediate operand of the add); the other one (where percpu_...() wasn't even used) is certainly a bigger win (most of which obviously could also be achieved using percpu_add()).
Quoted 2 lines
Keep in mind that although INC is smaller than ADD, the former has flag dependencies that the latter doesn't...
Wasn't that a problem just on Pentium4-s, which when I submitted another related patch a couple of months back I was told would not be a primary target anymore?
Jan
Quoted 8 lines · Jan Beulich
Quoted 3 lines
Keep in mind that although INC is smaller than ADD, the former has flag dependencies that the latter doesn't...
Wasn't that a problem just on Pentium4-s, which when I submitted another related patch a couple of months back I was told would not be a primary target anymore?
It doesn't look like it, from what I could tell after the abovementioned conversation... I was wondering mostly how many bytes this saved across the kernel. If it saves a byte in one place it's not so interesting, but if it is all over it might make more sense.
It bit much worse on P4 than on most other cores, though.
-hpa
Signature · 2 lines
H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf.
Quoted 4 lines
Quoted 1 line
Quoted 1 line
"H. Peter Anvin" <[email protected]> 22.04.10 08:48 >>>
I was wondering mostly how many bytes this saved across the kernel. If it saves a byte in one place it's not so interesting, but if it is all over it might make more sense.
It's about twenty places where this would get used.
Jan