All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay.com>
To: Benjamin LaHaise <bcrl@kvack.org>
Cc: Stephen Hemminger <shemminger@linux-foundation.org>,
	David Miller <davem@davemloft.net>,
	netdev@vger.kernel.org
Subject: Re: [patch 1/4] network dev read_mostly
Date: Thu, 15 Mar 2007 07:28:35 +0100	[thread overview]
Message-ID: <45F8E793.7040603@cosmosbay.com> (raw)
In-Reply-To: <20070315021840.GG1246@kvack.org>

Benjamin LaHaise a écrit :
> On Mon, Mar 12, 2007 at 02:08:18PM -0700, Stephen Hemminger wrote:
>> For Eric, mark packet type and network device watermarks
>> as read mostly.
> 
> The following x86-64 bits might be intersting, as they allow you to 
> completely eliminate the memory access for run time defined constants.  
> Note that read_always writes are non-atomic, so some other form of 
> protection is necessary for readers (and rcu won't cut it).  That can be 
> fixed somewhat by specifying the alignment for the mov instruction to 
> ensure writes are atomic, but for many uses that is overkill.  This kind 
> of change can make the biggest difference for high-latency cases, like L1 
> cache misses on the Prescott P4.  I've not benched it on a P4 of late, 
> though.
> 

Very very nice idea Ben !

However netdev_nit is not a good condidate because it might change quite often 
in fact :(

Clearly kmem_cache pointers are very good candidates.

One problem with your patch is that all read_always() of pointers are going to 
use 3 bytes more of code, thus raising icache pressure.

48 b8 c3 08 e8 8c af    mov    $0x71af8ce808c3,%rax
71 00 00

instead of %rip relative addressing

48 8b 05 99 f3 09 00    mov    652185(%rip),%rax



  parent reply	other threads:[~2007-03-15  6:28 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-12 21:08 [patch 0/4] more stuff for 2.6.22 Stephen Hemminger
2007-03-12 21:08 ` [patch 1/4] network dev read_mostly Stephen Hemminger
2007-03-12 21:34   ` David Miller
2007-03-13  5:37   ` Eric Dumazet
2007-03-13 21:26     ` [RFC] Get rid of netdev_nit Stephen Hemminger
2007-04-21  0:02       ` David Miller
2007-03-15  2:18   ` [patch 1/4] network dev read_mostly Benjamin LaHaise
2007-03-15  4:54     ` David Miller
2007-03-15  6:28     ` Eric Dumazet [this message]
2007-03-15  7:25       ` David Miller
2007-03-15  7:42         ` Eric Dumazet
2007-03-15 13:17         ` Benjamin LaHaise
2007-03-16 17:03           ` Stephen Hemminger
2007-03-15 15:10     ` Andi Kleen
2007-03-12 21:08 ` [patch 2/4] net: make seq_operations const Stephen Hemminger
2007-03-12 21:34   ` David Miller
2007-03-12 21:08 ` [patch 3/4] net: show bound packet types Stephen Hemminger
2007-03-12 21:35   ` David Miller
2007-03-12 21:08 ` [patch 4/4] tcp: statistics not read_mostly Stephen Hemminger
2007-03-12 21:15   ` David Miller
2007-03-12 21:26     ` Stephen Hemminger
2007-03-12 21:33       ` David Miller
2007-03-13 20:09       ` Andi Kleen

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=45F8E793.7040603@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=bcrl@kvack.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.