From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0636C43387 for ; Wed, 16 Jan 2019 16:50:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6CD2F205C9 for ; Wed, 16 Jan 2019 16:50:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Di79ehhL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388268AbfAPQue (ORCPT ); Wed, 16 Jan 2019 11:50:34 -0500 Received: from mail-vk1-f202.google.com ([209.85.221.202]:54325 "EHLO mail-vk1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727337AbfAPQud (ORCPT ); Wed, 16 Jan 2019 11:50:33 -0500 Received: by mail-vk1-f202.google.com with SMTP id b189so1497031vke.21 for ; Wed, 16 Jan 2019 08:50:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=BAGNFLMTm776d0TbKrSLSJfDpMJ/BarvU8U3iI4H1D8=; b=Di79ehhLYTBaz8x+WBRTTjrihulZ5Lsz9AZTFkOhrOroXil+fpFps/WLC9JksIB/VG EzJm8LH2cQvhRkjdwKj9Uo9EN7xnaOL9uDoNQeYKhgqvi7EplN1eWsc8QY+duVBdKO64 JEWwscWzaXtNqD5RGqzJouHbVUjcI7iybM5IZ6ni6yyGCZcjKytCnotCARn/8s/tc5iZ 0IQ4zfShYacRVZ6hrKc6GQ/+fdD774VBPhPGo4VHnBQfKVfA4RhkYctPZahs9D6o4akI xKwzYjHVrEOT/oXJTRBRCJryCQ8z8biWvdOLJYgQeJ6E/c4tjvZgY6t0rcbp+LNsKRrl UDRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=BAGNFLMTm776d0TbKrSLSJfDpMJ/BarvU8U3iI4H1D8=; b=p+Hkl0zb4qaKDGMUNiuGTG1FN6CsnsRgoqebcVCruiqbDc0OWEK18M/i/bgpiq1p0V w7FHU6+J7KRurcA8Zz1Kx4wQ0Q6Pc3mj48U2JN1Oklrq3h/1/UrtuXbLUp7d8/gvFA2P WLyAs3A8YACzLQ1JyaRhjhqNrXF+HJ5d5uUOxNIkn9D3z1KK9Qa1Z34C74k0wNLfQKHE 7qg/QNrOlncYY1bsEjpWJGpc9BSC3jkRnXHz+gwph3zKqMmsqqdyFiF9zyBbMLZj/11f NS//3/y+wv70twJIEVbkbOs9I3EG0pGeB2oEmCqWnUQtRot2RG51uaqSINCO9latCrun zT7Q== X-Gm-Message-State: AJcUukdeKEaeJHNJIchoTWK4wfRnEvs7EiuzpVVEzbwWQece9y6fipT+ f7VmXrAue24e0k8QnDpHmw8MxPF8 X-Google-Smtp-Source: ALg8bN5IElfoLaR7rcmg6ZyVOEmAkUkLRS3cH+fj5AXIKYJ35xk37G/LDFzR9wAgHbTh6M3BOoYGF1f6 X-Received: by 2002:a67:e99a:: with SMTP id b26mr6457358vso.10.1547657432754; Wed, 16 Jan 2019 08:50:32 -0800 (PST) Date: Wed, 16 Jan 2019 08:50:28 -0800 Message-Id: <20190116165028.105490-1-posk@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.20.1.97.g81188d93c3-goog Subject: [PATCH net-next] net: add a route cache full diagnostic message From: Peter Oskolkov To: David Miller , netdev@vger.kernel.org Cc: Peter Oskolkov , Peter Oskolkov Content-Type: text/plain; charset="UTF-8" Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org In some testing scenarios, dst/route cache can fill up so quickly that even an explicit GC call occasionally fails to clean it up. This leads to sporadically failing calls to dst_alloc and "network unreachable" errors to the user, which is confusing. This patch adds a diagnostic message to make the cause of the failure easier to determine. Signed-off-by: Peter Oskolkov --- net/core/dst.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/core/dst.c b/net/core/dst.c index 81ccf20e2826..a263309df115 100644 --- a/net/core/dst.c +++ b/net/core/dst.c @@ -98,8 +98,12 @@ void *dst_alloc(struct dst_ops *ops, struct net_device *dev, struct dst_entry *dst; if (ops->gc && dst_entries_get_fast(ops) > ops->gc_thresh) { - if (ops->gc(ops)) + if (ops->gc(ops)) { + printk_ratelimited(KERN_NOTICE "Route cache is full: " + "consider increasing sysctl " + "net.ipv[4|6].route.max_size.\n"); return NULL; + } } dst = kmem_cache_alloc(ops->kmem_cachep, GFP_ATOMIC); --