From patchwork Fri Jul 17 11:01:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konstantin Khlebnikov X-Patchwork-Id: 497080 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C062714029E for ; Fri, 17 Jul 2015 21:01:20 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=yandex-team.ru header.i=@yandex-team.ru header.b=iXM6zA5c; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757905AbbGQLBQ (ORCPT ); Fri, 17 Jul 2015 07:01:16 -0400 Received: from forward-corp1m.cmail.yandex.net ([5.255.216.100]:42359 "EHLO forward-corp1m.cmail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757746AbbGQLBP (ORCPT ); Fri, 17 Jul 2015 07:01:15 -0400 Received: from smtpcorp4.mail.yandex.net (smtpcorp4.mail.yandex.net [95.108.252.2]) by forward-corp1m.cmail.yandex.net (Yandex) with ESMTP id 0ABE36104D; Fri, 17 Jul 2015 14:01:11 +0300 (MSK) Received: from smtpcorp4.mail.yandex.net (localhost [127.0.0.1]) by smtpcorp4.mail.yandex.net (Yandex) with ESMTP id C1D202C02F7; Fri, 17 Jul 2015 14:01:11 +0300 (MSK) Received: from unknown (unknown [2a02:6b8:0:408:4567:37a9:80ac:7d4e]) by smtpcorp4.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id WytOHV8niZ-1B9CZkEf; Fri, 17 Jul 2015 14:01:11 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1437130871; bh=6W1a/YEoxZcC5VNlqjC6bpJGloKVuN13V1wPqMS6w70=; h=Subject:From:To:Cc:Date:Message-ID:User-Agent:MIME-Version: Content-Type:Content-Transfer-Encoding; b=iXM6zA5cnglPHvEzx67kqFLKrlE3ZfJR3nyncQtLHQxuOqkl+UBVnEK2V9/iZkwfs aBbn98yp/lW58rFpz1urzfvRL3BgyDCNZGlj5rPOKEdyFB6DdgxO4poZlAUh5yo/hE 3HtmqGrXdjiDtgpuH1Bj0pb1G0euKq7POgA3tNNc= Authentication-Results: smtpcorp4.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Subject: [PATCH v2] net: ratelimit warnings about dst entry refcount underflow or overflow From: Konstantin Khlebnikov To: netdev@vger.kernel.org, "David S. Miller" Cc: Eric Dumazet Date: Fri, 17 Jul 2015 14:01:11 +0300 Message-ID: <20150717110111.16718.77665.stgit@buzz> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Kernel generates a lot of warnings when dst entry reference counter overflows and becomes negative. That bug was seen several times at machines with outdated 3.10.y kernels. Most like it's already fixed in upstream. Anyway that flood completely kills machine and makes further debugging impossible. Signed-off-by: Konstantin Khlebnikov --- net/core/dst.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/core/dst.c b/net/core/dst.c index e956ce6d1378..002144bea935 100644 --- a/net/core/dst.c +++ b/net/core/dst.c @@ -284,7 +284,9 @@ void dst_release(struct dst_entry *dst) int newrefcnt; newrefcnt = atomic_dec_return(&dst->__refcnt); - WARN_ON(newrefcnt < 0); + if (unlikely(newrefcnt < 0)) + net_warn_ratelimited("%s: dst:%p refcnt:%d\n", + __func__, dst, newrefcnt); if (unlikely(dst->flags & DST_NOCACHE) && !newrefcnt) call_rcu(&dst->rcu_head, dst_destroy_rcu); }