* [PATCH net-next] net: keep name_hlist close to name
@ 2012-06-11 16:36 Eric Dumazet
2012-06-11 20:11 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2012-06-11 16:36 UTC (permalink / raw)
To: David Miller; +Cc: netdev
From: Eric Dumazet <edumazet@google.com>
__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>
---
include/linux/netdevice.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index d94cb14..a0b84e3 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -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)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: keep name_hlist close to name
2012-06-11 16:36 [PATCH net-next] net: keep name_hlist close to name Eric Dumazet
@ 2012-06-11 20:11 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-06-11 20:11 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 11 Jun 2012 18:36:13 +0200
> From: Eric Dumazet <edumazet@google.com>
>
> __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>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-06-11 20:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-11 16:36 [PATCH net-next] net: keep name_hlist close to name Eric Dumazet
2012-06-11 20:11 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).