David S. Miller a écrit : > From: Andrew Morton > Date: Fri, 23 Sep 2005 00:10:13 -0700 > > >>Ravikiran G Thirumalai wrote: >> >>>Hi Andrew, >>>This patchset contains alloc_percpu + bigrefs + bigrefs for netdevice >>>refcount. This patchset improves tbench lo performance by 6% on a 8 way IBM >>>x445. >> >>I think we'd need more comprehensive benchmarks than this before adding >>large amounts of complex core code. > > > I agree. tbench over loopback is about as far from real life > as it gets. > > I'm still against expanding these networking datastructures with > bigrefs just for this stuff. Some people have per-cpu and per-node on > the brain, and it's starting to bloat things up a little bit too much. Hi David I agree with you about bigref might be a bit of over-engineering for netdevice refcount. I sent one month ago a patch to reorder 'struct net_device' to at least make it SMP friendly, with no per-cpu or per-node additional memory but got no comment. It's important to place mostly read parts together, so that a cache lines can be shared by CPUS. It's important to separate hot fields in three different cache lines to that a cpu can work on the transmit while another is receiving frames without paying cache line ping pongs. Please (re)consider this patch since it really reduce CPU load and/or memory bus trafic between CPUS. I ask this question : - Is the following comment found in netdevice.h still true ? /* * This is the first field of the "visible" part of this structure * (i.e. as seen by users in the "Space.c" file). It is the name * the interface. */ If it is still true, then I suspect name_hlist cannot be moved like I did. Thank you - [NET] : Reorder some hot fields of struct net_device and place them on separate cache lines in SMP to lower memory bouncing between multiple CPU accessing the device. - One part is mostly used on receive path (including eth_type_trans()) (poll_list, poll, quota, weight, last_rx, dev_addr, broadcast) - One part is mostly used on queue transmit path (qdisc) (queue_lock, qdisc, qdisc_sleeping, qdisc_list, tx_queue_len) - One part is mostly used on xmit path (device) (xmit_lock, xmit_lock_owner, priv, hard_start_xmit, trans_start) 'features' is placed outside of these hot points, in a location that may be shared by all cpus (because mostly read) Minor but maybe not possible because of ABI : name_hlist is moved close to name[IFNAMSIZ] to speedup __dev_get_by_name() Signed-off-by: Eric Dumazet