Skip to content

Commit

Permalink
net: keep name_hlist close to name
Browse files Browse the repository at this point in the history
__dev_get_by_name() is slow because pm_qos_req has been inserted between
name[] and name_hlist, adding cache misses.

pm_qos_req has nothing to do at the beginning of struct net_device

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Jun 11, 2012
1 parent 67da255 commit 9136461
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -1046,10 +1046,9 @@ struct net_device {
*/
char name[IFNAMSIZ];

struct pm_qos_request pm_qos_req;

/* device name hash chain */
/* device name hash chain, please keep it close to name[] */
struct hlist_node name_hlist;

/* snmp alias */
char *ifalias;

Expand Down Expand Up @@ -1322,6 +1321,8 @@ struct net_device {

/* group the device belongs to */
int group;

struct pm_qos_request pm_qos_req;
};
#define to_net_dev(d) container_of(d, struct net_device, dev)

Expand Down

0 comments on commit 9136461

Please sign in to comment.