From: Anton Blanchard <anton@samba.org>
To: David Miller <davem@davemloft.net>
Cc: eric.dumazet@gmail.com, netdev@vger.kernel.org
Subject: Re: [PATCH] net: fix lock_sock_bh/unlock_sock_bh
Date: Thu, 27 May 2010 16:09:23 +1000 [thread overview]
Message-ID: <20100527060923.GD28295@kryten> (raw)
In-Reply-To: <20100526.222332.233688655.davem@davemloft.net>
> > [PATCH v2] net: fix lock_sock_bh/unlock_sock_bh
> >
> > This new sock lock primitive was introduced to speedup some user context
> > socket manipulation. But it is unsafe to protect two threads, one using
> > regular lock_sock/release_sock, one using lock_sock_bh/unlock_sock_bh
> >
> > This patch changes lock_sock_bh to be careful against 'owned' state.
> > If owned is found to be set, we must take the slow path.
> > lock_sock_bh() now returns a boolean to say if the slow path was taken,
> > and this boolean is used at unlock_sock_bh time to call the appropriate
> > unlock function.
> >
> > After this change, BH are either disabled or enabled during the
> > lock_sock_bh/unlock_sock_bh protected section. This might be misleading,
> > so we rename these functions to lock_sock_fast()/unlock_sock_fast().
> >
> > Reported-by: Anton Blanchard <anton@samba.org>
> > Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
>
> Looks good, I'll wait for positive testing from Anton before applying
> this.
Thanks guys, this fixed it.
Tested-by: Anton Blanchard <anton@samba.org>
Anton
next prev parent reply other threads:[~2010-05-27 6:09 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-25 11:58 Warning in net/ipv4/af_inet.c:154 Anton Blanchard
2010-05-25 15:27 ` Eric Dumazet
2010-05-26 3:19 ` Anton Blanchard
2010-05-26 5:18 ` Eric Dumazet
2010-05-26 7:56 ` David Miller
2010-05-26 10:12 ` Eric Dumazet
2010-05-27 3:56 ` Anton Blanchard
2010-05-27 4:06 ` David Miller
2010-05-27 4:21 ` Eric Dumazet
2010-05-27 4:18 ` Eric Dumazet
2010-05-27 4:21 ` David Miller
2010-05-27 5:06 ` [PATCH] net: fix lock_sock_bh/unlock_sock_bh Eric Dumazet
2010-05-27 5:20 ` Eric Dumazet
2010-05-27 5:23 ` David Miller
2010-05-27 6:09 ` Anton Blanchard [this message]
2010-05-27 7:29 ` David Miller
2010-05-29 7:21 ` Warning in net/ipv4/af_inet.c:154 David Miller
2010-05-31 16:02 ` [PATCH] net: sock_queue_err_skb() dont mess with sk_forward_alloc Eric Dumazet
2010-06-01 6:44 ` David 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=20100527060923.GD28295@kryten \
--to=anton@samba.org \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@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;
as well as URLs for NNTP newsgroup(s).