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


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to