Re: [patch 7/11] net: Use bigrefs for net_device.refcount

From: Ravikiran G Thirumalai
Date: Tue Sep 13 2005 - 13:54:23 EST


On Tue, Sep 13, 2005 at 08:27:52PM +0200, Eric Dumazet wrote:
> Ravikiran G Thirumalai a écrit :
>
> Hum...
>
> Did you tried to place refcnt/netdev_refcnt in a separate cache line than
> queue_lock ? I got good results too...
>
> > /* device queue lock */
> > spinlock_t queue_lock;
> > /* Number of references to this device */
> > - atomic_t refcnt;
> > + struct bigref netdev_refcnt ____cacheline_aligned_in_smp ;
> > /* delayed register/unregister */
> > struct list_head todo_list;
> > /* device name hash chain */
>
> Every time a cpu take the queue_lock spinlock, it exclusively gets one
> cache line. If another cpu try to access netdev_refcnt, it has to grab this
> cache line (even if properely per_cpu designed, there is still one shared
> field). In fact the whole struct net_device should be re-ordered for
> SMP/NUMA performance.

I agree. Maybe placing the queue_lock in a different cacheline is the
right approach?

Thanks,
Kiran
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/