Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1115474imm; Thu, 5 Jul 2018 15:11:35 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeXDCQ6qy6H+XMuJJGLQYbZ1HsZiWQX9Uq0fOLuxew/eZaNR7ZYa1G33AiKE+G3/kYa1zsF X-Received: by 2002:a63:4a07:: with SMTP id x7-v6mr7234136pga.34.1530828695283; Thu, 05 Jul 2018 15:11:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530828695; cv=none; d=google.com; s=arc-20160816; b=EKcMIIr+tdxnzbcV59HoKdNOEEP1Q/fbYQoVV6NYWuRNc9vXMoWPy2vo6kMWqDDdJG /JoURicZRIcMH4z51o6GE4qQ3Aiz7fW/MEw/HtSg4ascEXaYnBljM+EUDCzHhYTjQXGL 8fgiFXSq77R1eCcOuLyEW5zCD351NJCGdvC0wIND9/ueIlMOwnGaxmqVye0r0R6H9TQn JNQqhVxyVQa7KUYJt9uZs+v/TQLMzd6X0wbn0bQH6FglZCDWBjLUwK6xYW50MS40Ur1A rp9WQocVRjSK+Oj/l0Ag5mKTcQxbPeVmqn26/QVkfrryrTf3JZlfXdHMuM1c1iUVj9n/ vZRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=o94s8FglrzLrDLSpJ6EHFHWQAPssWVRZ8Ytyc59llAw=; b=XNsnXYOLV+R9XdsU/eJLJuAwFq4fyyY1o28td2asM6a1AsqdAsrv7lFAaXoLRWyxTf CdsN0ymwmMANCfNr7zCbGgDVg5k5bpHoTd9abIW8ClOSDqLl21LefIWgKOUt8UQc6S4M 5S6PW+bsdiwatKYq+OSDFZuUNe4781jo8cjxRyJS+rHOS/j509/OwWn7rhabCYmaZcVh tK1dl7cSvidB3HlH5uSo1HKfL1KEOLXEyN8mGzraoKWm9L/FXYteHnTsGwTNyBvOXW8H ijMCW35YX6k6nhU2IXWrgsS47uc2IZWbpVw4Iz00eXE193rGoZ5oPz4Hf7YwXq4/Vas2 byvQ== ARC-Authentication-Results: i=1; mx.google.com; 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 p61-v6si6849178plb.472.2018.07.05.15.11.20; Thu, 05 Jul 2018 15:11:35 -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; 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 S1753489AbeGEWKn (ORCPT + 99 others); Thu, 5 Jul 2018 18:10:43 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:38472 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753345AbeGEWKm (ORCPT ); Thu, 5 Jul 2018 18:10:42 -0400 Received: from localhost.localdomain (c-24-4-125-7.hsd1.ca.comcast.net [24.4.125.7]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id ABD7DE71; Thu, 5 Jul 2018 22:10:31 +0000 (UTC) Date: Thu, 5 Jul 2018 15:10:30 -0700 From: Andrew Morton To: Kirill Tkhai Cc: vdavydov.dev@gmail.com, shakeelb@google.com, viro@zeniv.linux.org.uk, hannes@cmpxchg.org, mhocko@kernel.org, tglx@linutronix.de, pombredanne@nexb.com, stummala@codeaurora.org, gregkh@linuxfoundation.org, sfr@canb.auug.org.au, guro@fb.com, mka@chromium.org, penguin-kernel@I-love.SAKURA.ne.jp, chris@chris-wilson.co.uk, longman@redhat.com, minchan@kernel.org, ying.huang@intel.com, mgorman@techsingularity.net, jbacik@fb.com, linux@roeck-us.net, linux-kernel@vger.kernel.org, linux-mm@kvack.org, willy@infradead.org, lirongqing@baidu.com, aryabinin@virtuozzo.com Subject: Re: [PATCH v8 05/17] mm: Assign memcg-aware shrinkers bitmap to memcg Message-Id: <20180705151030.c67eb9a989c5f0023a53d415@linux-foundation.org> In-Reply-To: References: <153063036670.1818.16010062622751502.stgit@localhost.localdomain> <153063056619.1818.12550500883688681076.stgit@localhost.localdomain> <20180703135000.b2322ae0e514f028e7941d3c@linux-foundation.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 4 Jul 2018 18:51:12 +0300 Kirill Tkhai wrote: > > - why aren't we decreasing shrinker_nr_max in > > unregister_memcg_shrinker()? That's easy to do, avoids pointless > > work in shrink_slab_memcg() and avoids memory waste in future > > prealloc_memcg_shrinker() calls. > > You sure, but there are some things. Initially I went in the same way > as memcg_nr_cache_ids is made and just took the same x2 arithmetic. > It never decreases, so it looked good to make shrinker maps like it. > It's the only reason, so, it should not be a problem to rework. > > The only moment is Vladimir strongly recommends modularity, i.e. > to have memcg_shrinker_map_size and shrinker_nr_max as different variables. For what reasons? > After the rework we won't be able to have this anymore, since memcontrol.c > will have to know actual shrinker_nr_max value and it will have to be exported. > > Could this be a problem? Vladimir?