Development issues regarding the cerowrt test router project
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: Felix Fietkau <nbd@openwrt.org>
Cc: Jerry Chu <hkchu@google.com>,
	cerowrt-devel <cerowrt-devel@lists.bufferbloat.net>,
	Yuchung Cheng <ycheng@google.com>
Subject: Re: [Cerowrt-devel] TFO crashes cerowrt 3.7.1-1
Date: Sun, 13 Jan 2013 20:07:28 -0800	[thread overview]
Message-ID: <CANn89i+VSYrFHLooptMiVhRdOAjb2d-AqxNrMpsVr_OgCDm7Kg@mail.gmail.com> (raw)
In-Reply-To: <CANn89iJm=f+SiL=m_QN4-SQAPfYaW4BJ91itdCge5T3N7bpaCQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2559 bytes --]

Quite frankly I would just remove the BUG_ON()

diff --git a/net/core/request_sock.c b/net/core/request_sock.c
index c31d9e8..4425148 100644
--- a/net/core/request_sock.c
+++ b/net/core/request_sock.c
@@ -186,8 +186,6 @@ void reqsk_fastopen_remove(struct sock *sk, struct
request_sock *req,
        struct fastopen_queue *fastopenq =
            inet_csk(lsk)->icsk_accept_queue.fastopenq;

-       BUG_ON(!spin_is_locked(&sk->sk_lock.slock) &&
!sock_owned_by_user(sk));
-
        tcp_sk(sk)->fastopen_rsk = NULL;
        spin_lock_bh(&fastopenq->lock);
        fastopenq->qlen--;



On Sun, Jan 13, 2013 at 7:05 PM, Eric Dumazet <edumazet@google.com> wrote:

> Oh well yes, this doesnt quite work on !SMP.
>
> And this kind of bug is frequent....
>
> See following example :
>
> commit b9980cdcf2524c5fe15d8cbae9c97b3ed6385563
> Author: Hugh Dickins <hughd@google.com>
> Date:   Wed Feb 8 17:13:40 2012 -0800
>
>     mm: fix UP THP spin_is_locked BUGs
>
>     Fix CONFIG_TRANSPARENT_HUGEPAGE=y CONFIG_SMP=n CONFIG_DEBUG_VM=y
>     CONFIG_DEBUG_SPINLOCK=n kernel: spin_is_locked() is then always false,
>     and so triggers some BUGs in Transparent HugePage codepaths.
>
>     asm-generic/bug.h mentions this problem, and provides a WARN_ON_SMP(x);
>     but being too lazy to add VM_BUG_ON_SMP, BUG_ON_SMP, WARN_ON_SMP_ONCE,
>     VM_WARN_ON_SMP_ONCE, just test NR_CPUS != 1 in the existing VM_BUG_ONs.
>
>     Signed-off-by: Hugh Dickins <hughd@google.com>
>     Cc: Andrea Arcangeli <aarcange@redhat.com>
>     Cc: <stable@vger.kernel.org>
>     Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
>     Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
>
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index b3ffc21..91d3efb 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -2083,7 +2083,7 @@ static void collect_mm_slot(struct mm_slot *mm_slot)
>  {
>         struct mm_struct *mm = mm_slot->mm;
>
> -       VM_BUG_ON(!spin_is_locked(&khugepaged_mm_lock));
> +       VM_BUG_ON(NR_CPUS != 1 && !spin_is_locked(&khugepaged_mm_lock));
>
>
>
>
> On Sun, Jan 13, 2013 at 1:39 PM, Felix Fietkau <nbd@openwrt.org> wrote:
>
>> On 2013-01-13 7:03 PM, Eric Dumazet wrote:
>> > I suspect a bug in the spin_is_locked() implementation on your arch, as
>> > he socket lock should be held at this point.
>> I don't think this is an arch implementation bug, this probably happens
>> on all !SMP systems. See this bit from include/linux/spinlock_up.h:
>>
>> #define arch_spin_is_locked(lock)   ((void)(lock), 0)
>>
>> - Felix
>>
>>
>

[-- Attachment #2: Type: text/html, Size: 5536 bytes --]

  reply	other threads:[~2013-01-14  4:07 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-04 17:04 Dave Taht
2013-01-04 17:27 ` Eric Dumazet
2013-01-04 17:33   ` Dave Taht
2013-01-04 20:42     ` Maciej Soltysiak
2013-01-04 20:43       ` Maciej Soltysiak
2013-01-04 20:57         ` Jerry Chu
2013-01-04 21:21           ` Dave Taht
2013-01-04 21:36             ` Jerry Chu
2013-01-04 21:44               ` Dave Taht
2013-01-04 21:01         ` dpreed
2013-01-04 22:49           ` Robert Bradley
2013-01-04 21:11       ` Dave Taht
2013-01-04 21:19         ` Jerry Chu
2013-01-05  1:59           ` Ketan Kulkarni
2013-01-05  2:20             ` Yuchung Cheng
2013-01-05  3:02               ` Ketan Kulkarni
2013-01-05  3:16                 ` Eric Dumazet
2013-01-05  3:35                 ` Dave Taht
2013-01-05  4:05                   ` Dave Taht
2013-01-05 19:13                 ` Ketan Kulkarni
2013-01-13 17:01                   ` Ketan Kulkarni
2013-01-13 18:03                     ` Eric Dumazet
2013-01-13 21:39                       ` Felix Fietkau
2013-01-14  0:38                         ` Yuchung Cheng
2013-01-14  3:05                         ` Eric Dumazet
2013-01-14  4:07                           ` Eric Dumazet [this message]
2013-01-14  4:43                             ` Ketan Kulkarni
2013-01-14  6:14                               ` Dave Taht
2013-01-14 19:50                                 ` Dave Taht
2013-01-14  8:18                           ` Jerry Chu
2013-01-14 16:32                             ` Eric Dumazet
2013-01-04 22:25       ` Robert Bradley
2013-01-14  6:11       ` Dave Taht
2013-01-14 16:37         ` Ketan Kulkarni
2013-01-16 22:19         ` Maciej Soltysiak
2013-01-17  0:58           ` Dave Taht
2013-01-17  3:44           ` Dave Taht

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

  List information: https://lists.bufferbloat.net/postorius/lists/cerowrt-devel.lists.bufferbloat.net/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANn89i+VSYrFHLooptMiVhRdOAjb2d-AqxNrMpsVr_OgCDm7Kg@mail.gmail.com \
    --to=edumazet@google.com \
    --cc=cerowrt-devel@lists.bufferbloat.net \
    --cc=hkchu@google.com \
    --cc=nbd@openwrt.org \
    --cc=ycheng@google.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