From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"<netdev@vger.kernel.org>" <netdev@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH] lib/dynamic_queue_limits.c: relax BUG_ON to WARN_ON in dql_complete()
Date: Wed, 18 Oct 2017 18:57:26 +0100 [thread overview]
Message-ID: <CAKv+Gu8hpcTBC-TxF898whrX0rYgiqf_ZiqUw2bzo6N_jOyLKw@mail.gmail.com> (raw)
In-Reply-To: <1508344188.31614.124.camel@edumazet-glaptop3.roam.corp.google.com>
On 18 October 2017 at 17:29, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Wed, 2017-10-18 at 16:45 +0100, Ard Biesheuvel wrote:
>> Even though calling dql_completed() with a count that exceeds the
>> queued count is a serious error, it still does not justify bringing
>> down the entire kernel with a BUG_ON(). So relax it to a WARN_ON()
>> instead.
>>
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> ---
>> lib/dynamic_queue_limits.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lib/dynamic_queue_limits.c b/lib/dynamic_queue_limits.c
>> index f346715e2255..24ce495d78f3 100644
>> --- a/lib/dynamic_queue_limits.c
>> +++ b/lib/dynamic_queue_limits.c
>> @@ -23,7 +23,7 @@ void dql_completed(struct dql *dql, unsigned int count)
>> num_queued = ACCESS_ONCE(dql->num_queued);
>>
>> /* Can't complete more than what's in queue */
>> - BUG_ON(count > num_queued - dql->num_completed);
>> + WARN_ON(count > num_queued - dql->num_completed);
>>
>> completed = dql->num_completed + count;
>> limit = dql->limit;
>
> So instead fixing the faulty driver, you'll have strange lockups, and
> force your users to reboot anyway, after annoying periods where
> "Internet does not work"
>
> These kinds of errors should be found when testing a new device driver
> or new kernel.
>
> Have you found the root cause ?
>
Not yet, and I don't intend to send out any patches for this
particular hardware until this is fixed.
But that still doesn't mean you should crash hard. As Linus puts it,
it is better to 'limp on' if you can (unless we're likely to corrupt
any non-volatile data, e.g., files on disk etc)
next prev parent reply other threads:[~2017-10-18 17:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-18 15:45 [PATCH] lib/dynamic_queue_limits.c: relax BUG_ON to WARN_ON in dql_complete() Ard Biesheuvel
2017-10-18 16:11 ` David Laight
2017-10-18 16:29 ` Eric Dumazet
2017-10-18 17:57 ` Ard Biesheuvel [this message]
2017-10-18 18:45 ` Eric Dumazet
2017-10-18 19:32 ` Ard Biesheuvel
2017-10-19 10:57 ` David Miller
2017-10-19 11:14 ` Ard Biesheuvel
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=CAKv+Gu8hpcTBC-TxF898whrX0rYgiqf_ZiqUw2bzo6N_jOyLKw@mail.gmail.com \
--to=ard.biesheuvel@linaro.org \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--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).