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=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS autolearn=unavailable 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 22780C43381 for ; Tue, 26 Mar 2019 18:17:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E8DB820823 for ; Tue, 26 Mar 2019 18:17:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=arista.com header.i=@arista.com header.b="LqmZqUMC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732468AbfCZSRR (ORCPT ); Tue, 26 Mar 2019 14:17:17 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:40330 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732064AbfCZSRQ (ORCPT ); Tue, 26 Mar 2019 14:17:16 -0400 Received: by mail-ed1-f68.google.com with SMTP id h22so11643490edw.7 for ; Tue, 26 Mar 2019 11:17:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=googlenew; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=NuoER88TjogJmel0bb/nMCUmRqawrRmoPl6DoA/n+a8=; b=LqmZqUMCgaZLbtj7+b7THviB4fWlSHMV9uOnH0e5u8A7bQUuZSRuDMYNAbvbj+1Lq5 t3tnPM0iL0+6HlhPPG+yfzw2a9Bo2Ih/p0gVKWCO3Fkn8YyZqCxtiL3lapX8wjJX0Xjl 5lrnBCNMeCKeyjeWMlPs43asZPbROwO57hu2vnTxNHNekIeZkq8zKETPIA9UvFJeaN8c 8g0pwRUEeM40Y2tIMwHrNBzHCC1lmQgDf4ZJ1G22PLTsDtdL8gXm141rsHDOSfcrdLj+ qm5CPIZQvN05sm0+o1NDWikbnytBwTZ2sRTLRjDg7ARtndAuSvdnVmqf4VsAXxGQQFpv ZmEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=NuoER88TjogJmel0bb/nMCUmRqawrRmoPl6DoA/n+a8=; b=q/3N1rOS2nHyauxp9wbgcfjaPuho3HgDw+s+NkGqr04Cp0T54hdmd4hk/APC5pkA0y LSI939azXrgBSVMPvBC6OeLouI1vrpyNcWWVobaTvqWG+JLqoG8ZAI5mGv1uInWY1Sgp 2HdKz+S1FMA4mEJUcyCQY3IlZQsj5ubW+O5XTqw7055eVUMl0eOIytOK2eR02NritprG OjAPXaKWpWxfg3nYIYQTwaRh+1HVomKe9G1HnOZ9SA6fOBhxwhAvbSIoUAc6FNUv6TD0 xxAk0xkGB3dtu2a8y5B68WtSiFYyboLt7+6Ko8L0oLDbxmnOO65W4eP3WCZ4MhiKcdKI 14Gw== X-Gm-Message-State: APjAAAXHl1WeRN+LWcv3PDE4yBHv/SIYde3ECZooBazgUUEkIYPzEth5 M4AdOmWkZZEFdAxGUyO6b0ZoGQ== X-Google-Smtp-Source: APXvYqwA8G7QnkgbfeksMB9bLb5fb+ESOVc/wSv5OCESsP9ELL/6dp63CIXVfeKAc7HqV6ZGL01j7Q== X-Received: by 2002:a50:94aa:: with SMTP id s39mr21939236eda.191.1553624234830; Tue, 26 Mar 2019 11:17:14 -0700 (PDT) Received: from [10.83.36.153] ([217.173.96.166]) by smtp.gmail.com with ESMTPSA id y4sm3064326edq.53.2019.03.26.11.17.13 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Tue, 26 Mar 2019 11:17:13 -0700 (PDT) Subject: Re: [RFC 4/4] net/ipv4/fib: Don't synchronise_rcu() every 512Kb To: David Ahern , linux-kernel@vger.kernel.org Cc: Alexander Duyck , Alexey Kuznetsov , "David S. Miller" , Eric Dumazet , Hideaki YOSHIFUJI , Ido Schimmel , netdev@vger.kernel.org References: <20190326153026.24493-1-dima@arista.com> <20190326153026.24493-5-dima@arista.com> <2f911647-f35f-13c2-8177-2fb93147b0fa@gmail.com> From: Dmitry Safonov Message-ID: Date: Tue, 26 Mar 2019 18:17:12 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.3 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 3/26/19 5:57 PM, David Ahern wrote: > On 3/26/19 11:15 AM, Dmitry Safonov wrote: >> I still wonder if it's good to expose it to userspace rather than >> shrinker, but this probably should work for me - I'll test it in near days. > > I did not know about the shrinker, so can not comment if it is better or > not. If so, my patch can always be reverted since it was just applied. Oh, don't misunderstand me - I didn't mean to say your patch is wrong, but I wondered what made this preferable for you. I've sent my patches as RFC, so probably - it's a place to discuss what's better, rather than running, rushing and reverting you commit. Initially, I was also thinking about introducing some sysctl like that, but thought it's a bit "dirty" solution to expose it to userspace for tuning, rather than make it work automatically in OOM. On other side with your sysctl, there are some minor bits, those are not-yet-perfect and asking to be improved if we go this way: 1. I've noticed that the limit is only being increased or set to zero. Which in turn can result in more calls to synchronise rcu than needed. 2. The memory summed up under the limit is only tnodes in tnode_free(), while nodes are not summed there. Also some tnodes are being freed with node_free(), if I'm not mistaken. So please, don't take me wrong, your patch may also work for me, but probably worth to discuss both ways and I very much value your opinion here. Thanks, Dmitry