net: netif_tx_queue_stopped too expensive
authorEric Dumazet <dada1@cosmosbay.com>
Tue, 28 Apr 2009 11:43:42 +0000 (04:43 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 28 Apr 2009 11:43:42 +0000 (04:43 -0700)
commit6a321cb370ad3db4ba6e405e638b3a42c41089b0
tree2e7c25cff76fc6b439afb04e24ab1133e42667b8
parent8555a5948467e941acc34e8b1c30df4c1f2f5862
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>
include/linux/netdevice.h