netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mitchell Blank Jr <mitch@sfgoth.com>
To: Francois Romieu <romieu@fr.zoreil.com>
Cc: netdev@oss.sgi.com
Subject: Re: [PATCH] tiny af_packet.c cleanup
Date: Sat, 13 Sep 2003 13:15:59 -0700	[thread overview]
Message-ID: <20030913201559.GI94744@gaz.sfgoth.com> (raw)
In-Reply-To: <20030913110353.B23840@electric-eye.fr.zoreil.com>

Francois Romieu wrote:
> Actually packet_rcv() is run in a BH context and doesn't race with
> SO_{ATTACH/DETACH}_FILTER from sock_setsockopt() which does the
> appropriate BH locking (spin_lock_bh(&sk->sk_lock.slock) in
> net/core/sock.c::sock_setsockopt and in net/core/filter.c::sk_attach_filter).
> packet_rcv() doesn't race with BH either due to the bh_lock_sock (a spin_lock
> in disguise) you quoted.

I don't understand what you're saying - are you saying that the locking
isn't needed?  Or just the recheck isn't needed?  It sounds like if we're
only avoiding the race because of the bh_lock_sock() then we do need to
recheck, right?

Could you do a patch for what you think it should look like?  You obviously
understand the locking issues here better than I.

-Mitch

  reply	other threads:[~2003-09-13 20:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-13  5:50 [PATCH] tiny af_packet.c cleanup Mitchell Blank Jr
2003-09-13  7:35 ` Francois Romieu
2003-09-13  8:02   ` Mitchell Blank Jr
2003-09-13  9:03     ` Francois Romieu
2003-09-13 20:15       ` Mitchell Blank Jr [this message]
2003-09-14 10:55         ` Francois Romieu
2003-09-14 11:26           ` Mitchell Blank Jr
2003-09-15 22:56             ` David S. Miller
2003-09-16  3:13               ` Mitchell Blank Jr
2003-09-16  5:41                 ` David S. Miller

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=20030913201559.GI94744@gaz.sfgoth.com \
    --to=mitch@sfgoth.com \
    --cc=netdev@oss.sgi.com \
    --cc=romieu@fr.zoreil.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;
as well as URLs for NNTP newsgroup(s).