From: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
To: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Subject: [PATCH] net: stop endless flood about dst entry refcount underflow or overflow
Date: Tue, 14 Jul 2015 14:43:05 +0300 [thread overview]
Message-ID: <20150714114305.17434.53731.stgit@buzz> (raw)
Kernel generates a lot of warnings when dst entry reference counter
overflows and becomes negative. This patch prints address of dst entry,
its refcount and then resets reference counter to INT_MAX/2.
That bug was seen several times at machines with outdated 3.10.y kernels.
Most like it's already fixed in upstream. Anyway flood of that warnings
completely kills machine and makes further debugging impossible.
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
---
net/core/dst.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/core/dst.c b/net/core/dst.c
index e956ce6d1378..2ed91082b3cf 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -284,7 +284,8 @@ void dst_release(struct dst_entry *dst)
int newrefcnt;
newrefcnt = atomic_dec_return(&dst->__refcnt);
- WARN_ON(newrefcnt < 0);
+ if (WARN(newrefcnt < 0, "dst: %p refcnt: %d\n", dst, newrefcnt))
+ atomic_set(&dst->__refcnt, INT_MAX / 2);
if (unlikely(dst->flags & DST_NOCACHE) && !newrefcnt)
call_rcu(&dst->rcu_head, dst_destroy_rcu);
}
next reply other threads:[~2015-07-14 11:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-14 11:43 Konstantin Khlebnikov [this message]
2015-07-14 12:04 ` [PATCH] net: stop endless flood about dst entry refcount underflow or overflow Eric Dumazet
2015-07-14 12:15 ` Konstantin Khlebnikov
2015-07-14 12:26 ` Eric Dumazet
2015-07-14 22:30 ` 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=20150714114305.17434.53731.stgit@buzz \
--to=khlebnikov@yandex-team.ru \
--cc=davem@davemloft.net \
--cc=edumazet@google.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).