results: Remove 8 bytes from struct page on 64bit archs

From: Anton Blanchard (
Date: Sun Jan 06 2002 - 20:25:55 EST


> I'm curious to see how large the tradeoff is with calculating
> virtual in page_address(). The overhead there may be larger than
> the win we get from better cacheline footprint in struct page

Check out:

"struct page can be hazardous to your health"

On this machine (2 way power3) we see a ~5% improvement on dbench by
removing ->zone. Quite a nice improvement.

When we also remove ->virtual and use pointer arithmetic to do
page_address() performance drops back down. The reason for this can
be found in:

Search for divd, remembering the percentage to the left is shifted one
instruction down. Yes divides really hurt.

Basically the difference is:

page_address() using page->virtual:

        ld 25,112(31)

page_address() using pointer arithmetic:

        .quad mem_map
        .quad 0xc000000000000000


        ld 9,.LC1
        li 11,120 ; sizeof(struct page)
        ld 10,.LC2
        ld 0,0(9)
        subf 0,0,31
        divd 0,0,11
        sldi 0,0,12
        add 25,0,10

Perhaps the compiler should be optimising this better (can we replace
the divide?)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Jan 07 2002 - 21:00:32 EST