All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Yongjun <yjwei@cn.fujitsu.com>
To: linux-sctp@vger.kernel.org
Subject: Re: [PATCH] sctp: avoid irq lock inversion while call sk->sk_data_ready()
Date: Mon, 08 Feb 2010 01:55:40 +0000	[thread overview]
Message-ID: <4B6F6F1C.5060404@cn.fujitsu.com> (raw)
In-Reply-To: <4B6903D6.8070106@cn.fujitsu.com>



Vlad Yasevich wrote:
> Wei Yongjun wrote:
>   
>> Vlad Yasevich wrote:
>>     
>>> Wei Yongjun wrote:
>>>   
>>>       
>>>> sk->sk_data_ready() of sctp socket can be called from both BH and non-BH
>>>> contexts, but the default sk->sk_data_ready(), sock_def_readable(), can
>>>> not be used in this case. Therefore, we have to make a new function
>>>> sctp_data_ready() to grab sk->sk_data_ready() with BH disabling.
>>>>
>>>>     
>>>>         
>>> Wouldn't the same inversion happen in TCP as well?  TCP can call that
>>> function in _bh and user contexts as well.
>>>   
>>>       
>> Not sure, but TCP does not call that function in user context at all.
>>
>>     
>
> Wei
>
> Can you trigger this problem with this patch applied?
>
> diff --git a/net/sctp/socket.c b/net/sctp/socket.c
> index 3a95fcb..dabdc50 100644
> --- a/net/sctp/socket.c
> +++ b/net/sctp/socket.c
> @@ -3717,9 +3717,9 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk)
>  	sp->hmac = NULL;
>
>  	SCTP_DBG_OBJCNT_INC(sock);
> -	percpu_counter_inc(&sctp_sockets_allocated);
>
>  	local_bh_disable();
> +	percpu_counter_inc(&sctp_sockets_allocated);
>  	sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1);
>  	local_bh_enable();
>
> -vlad

This patch did not change anything, the lockdep INFO still exists.

This lockdep INFO happend when I try to make a user abort through
sctp_primitive_ABORT.




      parent reply	other threads:[~2010-02-08  1:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-03  5:04 [PATCH] sctp: avoid irq lock inversion while call sk->sk_data_ready() Wei Yongjun
2010-02-03  9:51 ` Wei Yongjun
2010-02-03 17:14 ` Vlad Yasevich
2010-02-04  0:58 ` Wei Yongjun
2010-02-04 15:58 ` Vlad Yasevich
2010-02-05 19:19 ` Vlad Yasevich
2010-02-08  1:55 ` Wei Yongjun [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=4B6F6F1C.5060404@cn.fujitsu.com \
    --to=yjwei@cn.fujitsu.com \
    --cc=linux-sctp@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.