mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@mellanox.co.il>
To: Roland Dreier <rdreier@cisco.com>
Cc: Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org, openib-general@openib.org
Subject: Re: [openib-general] Re: [git patch review 1/4] IPoIB: Don't start send-only joins while multicast thread is stopped
Date: Sun, 12 Feb 2006 18:56:57 +0200	[thread overview]
Message-ID: <20060212165657.GA14127@mellanox.co.il> (raw)
In-Reply-To: <adazmkw3543.fsf@cisco.com>

Quoting r. Roland Dreier <rdreier@cisco.com>:
> Subject: Re: [openib-general] Re: [git patch review 1/4] IPoIB: Don't start send-only joins while multicast thread is stopped
> 
>     Michael> Basically, its as Andrew said: the lock around clear_bit
>     Michael> is there to ensure that ipoib_mcast_send isnt running
>     Michael> already when we stop the thread.  Thats why test_bit has
>     Michael> to be inside the lock, too.
> 
> Makes sense I guess.  If I'm understanding correctly, the lock isn't
> really there to serialize the bit ops, but rather to make sure
> ipoib_mcast_send() won't do anything after we clear the bit.

Right. Thats one way to put it.

> Does that mean that there's no reason to take the lock around the set_bit()?

Ugh, sorry, I dont really remember why I put it there.

I guess I just have easier time reasoning about locks than barriers and atomic
operations. "bit is protected by priv->lock" is a simple rule, and we are not on
data path here. The fact that the race went unnoticed for a while validates
this approach in my eyes.

I guess longer term we will replace mcast_mutex with priv->lock anyway, so it
doesnt matter much.

-- 
Michael S. Tsirkin
Staff Engineer, Mellanox Technologies

      reply	other threads:[~2006-02-12 16:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-11 20:22 Roland Dreier
2006-02-11 20:22 ` [git patch review 2/4] IPoIB: Fix another send-only join race Roland Dreier
2006-02-11 20:22   ` [git patch review 3/4] IB/mthca: Don't print debugging info until we have all values Roland Dreier
2006-02-11 20:22     ` [git patch review 4/4] IPoIB: Yet another fix for send-only joins Roland Dreier
2006-02-11 22:02 ` [git patch review 1/4] IPoIB: Don't start send-only joins while multicast thread is stopped Andrew Morton
2006-02-12  2:03   ` Roland Dreier
2006-02-12  7:50     ` [openib-general] " Michael S. Tsirkin
2006-02-12  8:13       ` Kyle Moffett
2006-02-12  8:19         ` Michael S. Tsirkin
2006-02-12 16:37       ` [openib-general] " Roland Dreier
2006-02-12 16:56         ` Michael S. Tsirkin [this message]

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=20060212165657.GA14127@mellanox.co.il \
    --to=mst@mellanox.co.il \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openib-general@openib.org \
    --cc=rdreier@cisco.com \
    /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®