Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1500424imm; Tue, 3 Jul 2018 12:20:42 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJIeMqDKk1KyEdtiOo9zuHa/GsW1NQTMVlc+dnm3Vy74ycoCOsMP7zz7nxtw3uqrEx9r8BF X-Received: by 2002:a65:5cc5:: with SMTP id b5-v6mr26345800pgt.425.1530645642745; Tue, 03 Jul 2018 12:20:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530645642; cv=none; d=google.com; s=arc-20160816; b=QRdqEVpp40EYZeXTszLuuT0YIvfQhzQ/2iX0tKdkhuaZ7rnIbveFnAbMgwWWjN6h8K YShjyVIco6NA+oRQrjtjJX+bYFGalXUTFL/HTkdKs0kp4tXDla+tLkfjatLPH/lE7jHr GF3YH8H2Y+VOXPx2NmhKFUHoyJO4yG5QE4qtnQWgdiAs71Ik8zJua8k7IR5qPid11trB SOBmbLfWSoIxLQibJ+iPN/JUELqTUae+vhK4D2t99zUgh3HZPWEYktIf1KNUfe42Tcti RHGXFKHufsf3ASkifAxN3q/o8edY1rcjVUOEKa3Xjth4wiZCOpWx/Xz5fyv6X3FAYw+q m5/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=heGv6udbXzO0xqQtylOJLEkgSvHSE6n2YUOdzGiz/V4=; b=qI6pTYsRbucIcq9ePG0zW7mjimjQu8cxBic4t5PfCITEmmhfT2wh7yiSPI1Jvn9w1d g/b2sZIYEF3/yCAptVeHA7/7uvH/8Ei4dSbSaLzvYlPnOG64jwdH7Z2XpKgNdPTKfnQz roGtTfLGiJt/tkNiYTOsd3gpv7Etd9EXEpnZ0Zkd3UYEy6HUOzoDJJLaOXwDs09ibo7k ZwmWGLia3Zx0BrzWIc5HFxgETCLSZfPs9voRrOzUlICLC4WbonxIfGdW1hGLXl+6zRSE nmJrv18nGtSwArD5hI78v4hWqrg/Fh+GGPKg3trHMxV0JsiqDdlOyryr5VMVW3ssLfBA juAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=P4MTYq1G; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s4-v6si1670801pfh.256.2018.07.03.12.20.28; Tue, 03 Jul 2018 12:20:42 -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=pass header.i=@google.com header.s=20161025 header.b=P4MTYq1G; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753640AbeGCTTu (ORCPT + 99 others); Tue, 3 Jul 2018 15:19:50 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:50902 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752145AbeGCTTt (ORCPT ); Tue, 3 Jul 2018 15:19:49 -0400 Received: by mail-wm0-f66.google.com with SMTP id v25-v6so3469123wmc.0 for ; Tue, 03 Jul 2018 12:19:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=heGv6udbXzO0xqQtylOJLEkgSvHSE6n2YUOdzGiz/V4=; b=P4MTYq1GU65DBLtptZkN2GH+n34oteeJa4v7D0/xOFZUNu0uMgG5aYt47Kw+xRsorv 7pldFIeByHcxR4wtDnToXCz5+uEDW1iGEIsyAnXCarS07fq+yWn+L1e0cTms8rEyk5Ge qD+aYttTGsiJE+M88/poknz/pZ9gRz5+yE+0cUzZ6k0qq9T3IcOhLzuMAn4OKCUfHyvw Wg/SbAmI+j1ntSQE9GEqgTQwz+YrJg/UmqlzBKnU8zBXp64SW9s230FX/5C4/R9QxIfC PbuaRCHUWk2hQMHoZWd+aLsRBVfxA4FsATo6fbEVKUhKC3Su+UOHfRv73kwvi/FeEFbo n4Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=heGv6udbXzO0xqQtylOJLEkgSvHSE6n2YUOdzGiz/V4=; b=MuE4EPtJThvYBAH0j1KJ5y7Bp2edpYmS9xKz1jJqnVt8G9HMm1+nx9LiUTkVnSBWuc PxVPnEkyjC6lQYey95TUIMOQurhQJNp+1gTFs2piq+/gbKIE3aEMdlhzoNNdWMLlEVHW KhBFUM9lh/X7pVWa2VrXMZSId5UzzVWjjaWwLa1GXEkag0IB/x3oBOKgJHSp7Kcm8GO1 ZYjqa8oFu7crxoYvkrrCRiKm8vyETmr4WhON/N2D/s/58ErYzAc7FKekJ6jKzNqp1c/K GkAZ8UozgEXTTZ2/nOtjRxJAj/T84ZgAtk8IqaaJihLzLvePHaeWFAi7e5yQj5KRVNwW fv5A== X-Gm-Message-State: APt69E0haEuwug2fgcfTZUjUbaIloazpiLzZwMPutdS4aK/eMc/MfTpi NknV0dvvOY/VS8eiPb8BBs/BIIhAIp+UyRVyRwDzmw== X-Received: by 2002:a1c:c501:: with SMTP id v1-v6mr12455699wmf.112.1530645587538; Tue, 03 Jul 2018 12:19:47 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <94c282fd-1b5a-e959-b344-01a51fd5fc2e@virtuozzo.com> From: Shakeel Butt Date: Tue, 3 Jul 2018 12:19:35 -0700 Message-ID: Subject: Re: [PATCH v8 03/17] mm: Assign id to every memcg-aware shrinker To: Kirill Tkhai Cc: Matthew Wilcox , 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 3, 2018 at 12:13 PM Kirill Tkhai wrote: > > On 03.07.2018 20:58, Matthew Wilcox wrote: > > On Tue, Jul 03, 2018 at 06:46:57PM +0300, Kirill Tkhai wrote: > >> shrinker_idr now contains only memcg-aware shrinkers, so all bits from memcg map > >> may be potentially populated. In case of memcg-aware shrinkers and !memcg-aware > >> shrinkers share the same numbers like you suggest, this will lead to increasing > >> size of memcg maps, which is bad for memory consumption. So, memcg-aware shrinkers > >> should to have its own IDR and its own numbers. The tricks like allocation big > >> IDs for !memcg-aware shrinkers seem bad for me, since they make the code more > >> complicated. > > > > 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. Shakeel