* Re: Is netif_tx_lock() SMP PREEMPT safe?
[not found] <200802151725.05424.mitov@issp.bas.bg>
@ 2008-02-15 16:01 ` Eric Dumazet
0 siblings, 0 replies; only message in thread
From: Eric Dumazet @ 2008-02-15 16:01 UTC (permalink / raw)
To: Marin Mitov; +Cc: linux-kernel, netdev
Marin Mitov a écrit :
> 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?
>
>
Hi Marin
This expands to the first version, but netif_tx_lock() is allways called
with preemption disabled.
(Or checks in smp_processor_id() would just trigger)
Eric
(Cced netdev for network related stuff)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-02-15 16:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200802151725.05424.mitov@issp.bas.bg>
2008-02-15 16:01 ` Is netif_tx_lock() SMP PREEMPT safe? Eric Dumazet
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).