提交 9136461a 编写于 作者: E Eric Dumazet 提交者: David S. Miller

net: keep name_hlist close to name

__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: NEric Dumazet <edumazet@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 67da2552
......@@ -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;
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册