<p>Thanks Eric and Yuchung for taking care of the patch. I will test few more TFO cases as well once this patch is built in cero.</p>
<p>Thanks,<br>
Ketan</p>
<p>On Jan 14, 2013 9:37 AM, "Eric Dumazet" <<a href="mailto:edumazet@google.com">edumazet@google.com</a>> wrote:<br>
><br>
> Quite frankly I would just remove the BUG_ON()<br>
><br>
> diff --git a/net/core/request_sock.c b/net/core/request_sock.c<br>
> index c31d9e8..4425148 100644<br>
> --- a/net/core/request_sock.c<br>
> +++ b/net/core/request_sock.c<br>
> @@ -186,8 +186,6 @@ void reqsk_fastopen_remove(struct sock *sk, struct request_sock *req,<br>
> struct fastopen_queue *fastopenq =<br>
> inet_csk(lsk)->icsk_accept_queue.fastopenq;<br>
> <br>
> - BUG_ON(!spin_is_locked(&sk->sk_lock.slock) && !sock_owned_by_user(sk));<br>
> -<br>
> tcp_sk(sk)->fastopen_rsk = NULL;<br>
> spin_lock_bh(&fastopenq->lock);<br>
> fastopenq->qlen--;<br>
><br>
><br>
><br>
> On Sun, Jan 13, 2013 at 7:05 PM, Eric Dumazet <<a href="mailto:edumazet@google.com">edumazet@google.com</a>> wrote:<br>
>><br>
>> Oh well yes, this doesnt quite work on !SMP.<br>
>><br>
>> And this kind of bug is frequent....<br>
>><br>
>> See following example :<br>
>><br>
>> commit b9980cdcf2524c5fe15d8cbae9c97b3ed6385563<br>
>> Author: Hugh Dickins <<a href="mailto:hughd@google.com">hughd@google.com</a>><br>
>> Date: Wed Feb 8 17:13:40 2012 -0800<br>
>><br>
>> mm: fix UP THP spin_is_locked BUGs<br>
>> <br>
>> Fix CONFIG_TRANSPARENT_HUGEPAGE=y CONFIG_SMP=n CONFIG_DEBUG_VM=y<br>
>> CONFIG_DEBUG_SPINLOCK=n kernel: spin_is_locked() is then always false,<br>
>> and so triggers some BUGs in Transparent HugePage codepaths.<br>
>> <br>
>> asm-generic/bug.h mentions this problem, and provides a WARN_ON_SMP(x);<br>
>> but being too lazy to add VM_BUG_ON_SMP, BUG_ON_SMP, WARN_ON_SMP_ONCE,<br>
>> VM_WARN_ON_SMP_ONCE, just test NR_CPUS != 1 in the existing VM_BUG_ONs.<br>
>> <br>
>> Signed-off-by: Hugh Dickins <<a href="mailto:hughd@google.com">hughd@google.com</a>><br>
>> Cc: Andrea Arcangeli <<a href="mailto:aarcange@redhat.com">aarcange@redhat.com</a>><br>
>> Cc: <<a href="mailto:stable@vger.kernel.org">stable@vger.kernel.org</a>><br>
>> Signed-off-by: Andrew Morton <<a href="mailto:akpm@linux-foundation.org">akpm@linux-foundation.org</a>><br>
>> Signed-off-by: Linus Torvalds <<a href="mailto:torvalds@linux-foundation.org">torvalds@linux-foundation.org</a>><br>
>><br>
>> diff --git a/mm/huge_memory.c b/mm/huge_memory.c<br>
>> index b3ffc21..91d3efb 100644<br>
>> --- a/mm/huge_memory.c<br>
>> +++ b/mm/huge_memory.c<br>
>> @@ -2083,7 +2083,7 @@ static void collect_mm_slot(struct mm_slot *mm_slot)<br>
>> {<br>
>> struct mm_struct *mm = mm_slot->mm;<br>
>> <br>
>> - VM_BUG_ON(!spin_is_locked(&khugepaged_mm_lock));<br>
>> + VM_BUG_ON(NR_CPUS != 1 && !spin_is_locked(&khugepaged_mm_lock));<br>
>><br>
>><br>
>><br>
>><br>
>> On Sun, Jan 13, 2013 at 1:39 PM, Felix Fietkau <<a href="mailto:nbd@openwrt.org">nbd@openwrt.org</a>> wrote:<br>
>>><br>
>>> On 2013-01-13 7:03 PM, Eric Dumazet wrote:<br>
>>> > I suspect a bug in the spin_is_locked() implementation on your arch, as<br>
>>> > he socket lock should be held at this point.<br>
>>> I don't think this is an arch implementation bug, this probably happens<br>
>>> on all !SMP systems. See this bit from include/linux/spinlock_up.h:<br>
>>><br>
>>> #define arch_spin_is_locked(lock) ((void)(lock), 0)<br>
>>><br>
>>> - Felix<br>
>>><br>
>><br>
><br>
</p>