mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marin Mitov <mitov@issp.bas.bg>
To: linux-kernel@vger.kernel.org
Subject: Is netif_tx_lock() SMP PREEMPT safe?
Date: Fri, 15 Feb 2008 17:25:05 +0200	[thread overview]
Message-ID: <200802151725.05424.mitov@issp.bas.bg> (raw)

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



             reply	other threads:[~2008-02-15 15:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-15 15:25 Marin Mitov [this message]
2008-02-15 16:01 ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200802151725.05424.mitov@issp.bas.bg \
    --to=mitov@issp.bas.bg \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®