public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba.org>
To: Dave Jones <davej@suse.de>
Cc: "David S. Miller" <davem@redhat.com>, linux-kernel@vger.kernel.org
Subject: results: Remove 8 bytes from struct page on 64bit archs
Date: Mon, 7 Jan 2002 12:25:55 +1100	[thread overview]
Message-ID: <20020107012555.GA6623@krispykreme> (raw)
In-Reply-To: <20020106.060824.106263786.davem@redhat.com> <Pine.LNX.4.33.0201061542450.3859-100000@Appserv.suse.de>
In-Reply-To: <Pine.LNX.4.33.0201061542450.3859-100000@Appserv.suse.de>

 
Hi,

> 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:

http://samba.org/~anton/linux/struct_page/

"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:

http://samba.org/~anton/linux/struct_page/2.4.18pre1-nopagezone-nopagevirtual/2/6.html

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:

.LC1:
        .quad   mem_map
.LC2:
        .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?)

Anton

  reply	other threads:[~2002-01-07  1:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-06 12:39 [PATCH] Remove 8 bytes from struct page on 64bit archs Anton Blanchard
2002-01-06 13:02 ` Horst von Brand
2002-01-06 13:07 ` Dave Jones
2002-01-06 13:13   ` Momchil Velikov
2002-01-06 13:25     ` Dave Jones
2002-01-06 13:28   ` William Lee Irwin III
2002-01-06 14:08   ` David S. Miller
2002-01-06 14:44     ` Dave Jones
2002-01-07  1:25       ` Anton Blanchard [this message]
2002-01-07  3:22         ` results: " Richard Henderson
2002-01-14  6:35           ` Anton Blanchard
2002-01-15  0:45             ` Dave Jones
2002-01-07  5:13         ` David S. Miller
2002-01-06 13:11 ` [PATCH] " William Lee Irwin III
2002-01-06 13:33   ` Anton Blanchard
2002-01-06 13:51     ` William Lee Irwin III

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020107012555.GA6623@krispykreme \
    --to=anton@samba.org \
    --cc=davej@suse.de \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox