diff options
author | Eric Dumazet <dada1@cosmosbay.com> | 2009-04-28 07:43:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-28 07:43:42 -0400 |
commit | 6a321cb370ad3db4ba6e405e638b3a42c41089b0 (patch) | |
tree | 2e7c25cff76fc6b439afb04e24ab1133e42667b8 /include/linux/netdevice.h | |
parent | 8555a5948467e941acc34e8b1c30df4c1f2f5862 (diff) |
net: netif_tx_queue_stopped too expensive
netif_tx_queue_stopped(txq) is most of the time false.
Yet its cost is very expensive on SMP.
static inline int netif_tx_queue_stopped(const struct netdev_queue *dev_queue)
{
return test_bit(__QUEUE_STATE_XOFF, &dev_queue->state);
}
I saw this on oprofile hunting and bnx2 driver bnx2_tx_int().
We probably should split "struct netdev_queue" in two parts, one
being read mostly.
__netif_tx_lock() touches _xmit_lock & xmit_lock_owner, these
deserve a separate cache line.
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index f8c3619d551f..505a3c6cb12d 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -447,12 +447,18 @@ enum netdev_queue_state_t | |||
447 | }; | 447 | }; |
448 | 448 | ||
449 | struct netdev_queue { | 449 | struct netdev_queue { |
450 | /* | ||
451 | * read mostly part | ||
452 | */ | ||
450 | struct net_device *dev; | 453 | struct net_device *dev; |
451 | struct Qdisc *qdisc; | 454 | struct Qdisc *qdisc; |
452 | unsigned long state; | 455 | unsigned long state; |
453 | spinlock_t _xmit_lock; | ||
454 | int xmit_lock_owner; | ||
455 | struct Qdisc *qdisc_sleeping; | 456 | struct Qdisc *qdisc_sleeping; |
457 | /* | ||
458 | * write mostly part | ||
459 | */ | ||
460 | spinlock_t _xmit_lock ____cacheline_aligned_in_smp; | ||
461 | int xmit_lock_owner; | ||
456 | } ____cacheline_aligned_in_smp; | 462 | } ____cacheline_aligned_in_smp; |
457 | 463 | ||
458 | 464 | ||