Subject: Re: [PATCH] convert hh_lock to seqlock

From: Eric Dumazet <[email-masked]>
Date: Thu, 07 Dec 2006 21:23:07 +0100

Stephen Hemminger a écrit :
> The hard header cache is in the main output path, so using
> seqlock instead of reader/writer lock should reduce overhead.
> 

Nice work Stephen, I am very interested.

Did you benchmarked it ?

I ask because I think hh_refcnt frequent changes may defeat the gain you want 
(ie avoiding cache line ping pongs between cpus). seqlock are definitly better 
than rwlock, but if we really keep cache lines shared.

So I would suggest reordering fields of hh_cache and adding one 
____cacheline_aligned_in_smp to keep hh_refcnt in another cache line.

(hh_len, hh_lock and hh_data should be placed on a 'mostly read' cache line)

Thank you
Eric