I don't think it is a good idea, if you kill map_nr, you kill it in all
ports. And e.g. old 32bit sparc generates for division by 44 this:
%o0 <= (%o0 - %o1) / 44
sub %o0,%o1,%o1
sll %o1,5,%g2
sub %g2,%o1,%g2
sll %g2,5,%g2
add %g2,%o1,%g2
sll %g2,3,%g3
add %g2,%g3,%g2
sll %g2,15,%o0
sub %o0,%g2,%o0
sll %o0,2,%o0
add %o0,%o1,%o0
sub %g0,%o0,%o0
sra %o0,2,%o0
so it would need serious testing on all archs to see if it is a win, not
just a kernel compile on one machine.
On sparc64, for division by 80, one has to build a 64bit constant, so it is
rather long as well:
sethi %hi(0xcccccccc), %g2
sub %o0, %o1, %o0
or %g2, 0xcc, %g3
sllx %g3, 32, %g3
or %g2, 0xcd, %g2
add %g3, %g2, %g3 ! %g3 = 0xcccccccccccccccd
mulx %o0, %g3, %o0
srax %o0, 4, %o0
So, if you think it is a win on some architecture, move struct page to asm*
headers and make some macros for map_nr
(e.g.
#define map_nr(page) ((page) - mem_map)
on archs which will miss the map_nr pointer
and
#define map_nr(page) ((page)->_map_nr)
on others
).
Cheers,
Jakub
___________________________________________________________________
Jakub Jelinek | jj@sunsite.mff.cuni.cz | http://sunsite.mff.cuni.cz
Administrator of SunSITE Czech Republic, MFF, Charles University
___________________________________________________________________
UltraLinux | http://ultra.linux.cz/ | http://ultra.penguin.cz/
Linux version 2.2.0-pre7 on a sparc64 machine (3958.37 BogoMips)
___________________________________________________________________
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/