public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Is netif_tx_lock() SMP PREEMPT safe?
@ 2008-02-15 15:25 Marin Mitov
  2008-02-15 16:01 ` Eric Dumazet
  0 siblings, 1 reply; 2+ messages in thread
From: Marin Mitov @ 2008-02-15 15:25 UTC (permalink / raw)
  To: linux-kernel

Hi all,

As in: include/linux/netdevice.h (kernel-2.6.24.2) one finds:

static inline void __netif_tx_lock(struct net_device *dev, int cpu)
{
        spin_lock(&dev->_xmit_lock);
        dev->xmit_lock_owner = cpu;
}

static inline void netif_tx_lock(struct net_device *dev)
{
        __netif_tx_lock(dev, smp_processor_id());
}

Does netif_tx_lock(struct net_device *dev) expands into:

cpu = smp_processor_id(); 
<preempt & shift to another cpu (bogus)>
spin_lock(&dev->_xmit_lock);
dev->xmit_lock_owner = cpu; /* cpu is not the lock owner */

Or to:

spin_lock(&dev->_xmit_lock);
dev->xmit_lock_owner = smp_processor_id();

which is correct?

Thanks in advance for your answer.

Regards

Marin Mitov



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-15 16:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-15 15:25 Is netif_tx_lock() SMP PREEMPT safe? Marin Mitov
2008-02-15 16:01 ` Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox