Przeglądaj źródła

netdevice: shrink size of struct netdev_queue

- trans_timeout is incremented when tx queue timed out (tx watchdog).
- tx_maxrate is set via sysfs

Moving tx_maxrate to read-mostly part shrinks the struct by 64 bytes.
While at it, also move trans_timeout (it is out-of-place in the
'write-mostly' part).

Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Florian Westphal 9 lat temu
rodzic
commit
c0ef079ca7
1 zmienionych plików z 6 dodań i 7 usunięć
  1. 6 7
      include/linux/netdevice.h

+ 6 - 7
include/linux/netdevice.h

@@ -569,6 +569,12 @@ struct netdev_queue {
 #if defined(CONFIG_XPS) && defined(CONFIG_NUMA)
 #if defined(CONFIG_XPS) && defined(CONFIG_NUMA)
 	int			numa_node;
 	int			numa_node;
 #endif
 #endif
+	unsigned long		tx_maxrate;
+	/*
+	 * Number of TX timeouts for this queue
+	 * (/sys/class/net/DEV/Q/trans_timeout)
+	 */
+	unsigned long		trans_timeout;
 /*
 /*
  * write-mostly part
  * write-mostly part
  */
  */
@@ -579,18 +585,11 @@ struct netdev_queue {
 	 */
 	 */
 	unsigned long		trans_start;
 	unsigned long		trans_start;
 
 
-	/*
-	 * Number of TX timeouts for this queue
-	 * (/sys/class/net/DEV/Q/trans_timeout)
-	 */
-	unsigned long		trans_timeout;
-
 	unsigned long		state;
 	unsigned long		state;
 
 
 #ifdef CONFIG_BQL
 #ifdef CONFIG_BQL
 	struct dql		dql;
 	struct dql		dql;
 #endif
 #endif
-	unsigned long		tx_maxrate;
 } ____cacheline_aligned_in_smp;
 } ____cacheline_aligned_in_smp;
 
 
 static inline int netdev_queue_numa_node_read(const struct netdev_queue *q)
 static inline int netdev_queue_numa_node_read(const struct netdev_queue *q)