Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1505888imm; Tue, 3 Jul 2018 12:27:37 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc4fv3VrWyax+TOhgzXUfQeCv2+JhsYgexpBVpXACDyO1AoY/WOMbn0GsTDdAJifLtS6Jyh X-Received: by 2002:a62:5582:: with SMTP id j124-v6mr11193472pfb.20.1530646057847; Tue, 03 Jul 2018 12:27:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530646057; cv=none; d=google.com; s=arc-20160816; b=L1F6KLZUNpPKskSBmnykTEYCW0G8SHl9jrTDGdJXkm/VDaw5U6TKKDhN724yYEGfps mfsWCjDaQ++VgeriGxUSSOaZ6F/vaKTO+VfWpPL+6PzZWC4k9C5m5xkEA1zybqMu62Dp 3MzgQT11k6Ts9R2sgr0tijBZkspTG87V4HVgDzQYvmJws7ZQXvo0PZQ5ZWUWo+Bkouit cNrF8oRU5O7vAVdBt7ECClfjcfPrm6Dw5dXuHsGL185+8nK8py9mEA80gjIeysZ3lhEK bx5hwmzmhUz2Tj2MGhNH3wILC8BfWKfEmkvJjxjtbbB/Sj08TvC98hz65baUpWmvy9Dy 4mjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=avtgIFaAPOdfeP7X3pYeyLrJPaeiHPelWWqFh0hmLSA=; b=rwyyZ4+7fELb+ylboDgh+OMe00r1sfVM1hc+pwrseHVpfRHNq9HJK/QBtqYDl5IyGk 5t4NVrAfr+lbPkCNoDjnVY0QU/duvLHED1WhORlVQUH7nHMjp+fjriF3mQMa9XHA647O kWLTKrsl8D1F9SPyNH//p1IumIzVgu97OJxqJvIG5PYtmxHiXNw3lXclAhwDT2DRPqK7 y9/LMO+961bezgb3dvYJuY1zZuNgr/+bW/e8klooH+k6d/AP8KMGhoVcOhV4Wv4V0rj5 fNCX4tzOllN2OwBWx/jZiN+leuM6V5yTwopgD8Ygv3NeiSQWVwLi20wj38MM5ETQH3WP xhiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=mraLDIX5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z13-v6si1698045plo.287.2018.07.03.12.27.23; Tue, 03 Jul 2018 12:27:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=mraLDIX5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934409AbeGCT0D (ORCPT + 99 others); Tue, 3 Jul 2018 15:26:03 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:35250 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933196AbeGCT0B (ORCPT ); Tue, 3 Jul 2018 15:26:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=avtgIFaAPOdfeP7X3pYeyLrJPaeiHPelWWqFh0hmLSA=; b=mraLDIX5Hf+a2JIbF450DHnj6 LihoDe9j6hLL3w19u1TL37xd1nr3kWcdOSxVNvl8rPwhsT3t4GFyNwX6rzY1Okx/Oi4bYHyiUuQU3 WNR7w/Byh84agm2Cc6BTdPfW6ji98OekPKp/6hGwa8ZhKN8K8MNG1A5veW3avUoT2AVK+YyQ8ThHe xW9O4OHBwYyrAKX3SsJ3SBEo6rSGiWXrVpZbkFQ+xKUcRyb6k7Ln6Ds6x492ZdsbZ/ACtmzU58S/F 3aPQzczPKuAIQ+Ujfz5aO/aFDfNe7De/V99y9k8Ol5YQ+C8nUqqFmy/FRwxEo/zQ1H0+I/bRS/U/4 1U75qGe5g==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1faQvN-0004Sw-8R; Tue, 03 Jul 2018 19:25:17 +0000 Date: Tue, 3 Jul 2018 12:25:17 -0700 From: Matthew Wilcox To: Shakeel Butt Cc: Kirill Tkhai , Vladimir Davydov , Alexander Viro , Johannes Weiner , Michal Hocko , Thomas Gleixner , Philippe Ombredanne , stummala@codeaurora.org, gregkh@linuxfoundation.org, Stephen Rothwell , Roman Gushchin , mka@chromium.org, Tetsuo Handa , Chris Wilson , longman@redhat.com, Minchan Kim , Huang Ying , Mel Gorman , jbacik@fb.com, Guenter Roeck , LKML , Linux MM , lirongqing@baidu.com, Andrey Ryabinin , Andrew Morton Subject: Re: [PATCH v8 03/17] mm: Assign id to every memcg-aware shrinker Message-ID: <20180703192517.GA22738@bombadil.infradead.org> References: <153063036670.1818.16010062622751502.stgit@localhost.localdomain> <153063054586.1818.6041047871606697364.stgit@localhost.localdomain> <20180703152723.GB21590@bombadil.infradead.org> <2d845a0d-d147-7250-747e-27e493b6a627@virtuozzo.com> <20180703175808.GC4834@bombadil.infradead.org> <94c282fd-1b5a-e959-b344-01a51fd5fc2e@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 03, 2018 at 12:19:35PM -0700, Shakeel Butt wrote: > On Tue, Jul 3, 2018 at 12:13 PM Kirill Tkhai wrote: > > > Do we really have so very many !memcg-aware shrinkers? > > > > > > $ git grep -w register_shrinker |wc > > > 32 119 2221 > > > $ git grep -w register_shrinker_prepared |wc > > > 4 13 268 > > > (that's an overstatement; one of those is the declaration, one the definition, > > > and one an internal call, so we actually only have one caller of _prepared). > > > > > > So it looks to me like your average system has one shrinker per > > > filesystem, one per graphics card, one per raid5 device, and a few > > > miscellaneous. I'd be shocked if anybody had more than 100 shrinkers > > > registered on their laptop. > > > > > > I think we should err on the side of simiplicity and just have one IDR for > > > every shrinker instead of playing games to solve a theoretical problem. > > > > It just a standard situation for the systems with many containers. Every mount > > introduce a new shrinker to the system, so it's easy to see a system with > > 100 or ever 1000 shrinkers. AFAIR, Shakeel said he also has the similar > > configurations. > > > > I can say on our production systems, a couple thousand shrinkers is normal. But how many are !memcg aware? It sounds to me like almost all of the shrinkers come through the sget_userns() caller, so the other shrinkers are almost irrelevant.