Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2861341imm; Tue, 4 Sep 2018 11:08:59 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYe/GocKmRFd6RjgRA7kTHXOvmbHtIBAfcy+lsENDZBSbHEoYLerSLZb/IeDqkJROirO1kJ X-Received: by 2002:a17:902:127:: with SMTP id 36-v6mr35628987plb.178.1536084538882; Tue, 04 Sep 2018 11:08:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536084538; cv=none; d=google.com; s=arc-20160816; b=McPaWXnaJtSqUjVEz5U7wr9I/gTpC338pnnlyO4befbV6tyMPNnv9CL8o3/J2uSmak vKkdct55+VLzm7I1gPV5C9RRKr62v1bp7CXa2ou5wrLpJa7NgpM0nixOMB9y1erSecAM IjW82g0LJt2TCEvTTQzoG8niY3QCBLaMgNaYXpF4UhV+5cy3OMbJINEaNzSZYNnYI1VX UkUfM/AYY3N00tHqOq+opFv7cIb+W6EMyDAZd+7qL68orfcGGy++xGFLkH5ocZ9eWlEp JFQ9GRIW7EHqsZrYhR6OrrtOYgMx5RVmv5HFPEyu/no4b3hjgPvNLWxhtZgM7688qECh Hhfg== 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:arc-authentication-results; bh=4pSxEPPDOBaHcEPfIyCFZfXGEZUuINDdIuumWlXM+iY=; b=eBVdsnT+j/RZWdEivjm1I+onVknFWhG2rFsKAqqX7IBz4VpUFEbM/zlu6vqj58U1rn oPMDeByr71WFKWly1dpwNA2divqqTIhj54IHXhXhBoH2kE2AKYXKEsLxyAr9EAhYHlHS DqWrmO4zdf+GJYxPFkThTyGyGU0QdzIFT/G1aVduTaxBqpVfp8QuI8kErgGf/e2GaQ2u UqsiXHEzdEXStg0T5kkH3OZPTt8RW0IghwQe+CFWRkESZbOzfm7zhdq1LIPK67lSOOOH 98zi62t47JgP5zSMPF1VMSMDgLZIZ/OsycW3CEufNcxd2Byy3AW/8bDJoRO4C5lxCqMs EaGw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o1-v6si22886844plb.499.2018.09.04.11.08.42; Tue, 04 Sep 2018 11:08:58 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727868AbeIDWdX (ORCPT + 99 others); Tue, 4 Sep 2018 18:33:23 -0400 Received: from mx2.suse.de ([195.135.220.15]:48834 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726437AbeIDWdX (ORCPT ); Tue, 4 Sep 2018 18:33:23 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D35B3B0CA; Tue, 4 Sep 2018 18:07:08 +0000 (UTC) Date: Tue, 4 Sep 2018 20:07:07 +0200 From: Michal Hocko To: Roman Gushchin Cc: Rik van Riel , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, Josef Bacik , Johannes Weiner , Andrew Morton , Vladimir Davydov Subject: Re: [PATCH] mm: slowly shrink slabs with a relatively small number of objects Message-ID: <20180904180707.GS14951@dhcp22.suse.cz> References: <20180831203450.2536-1-guro@fb.com> <3b05579f964cca1d44551913f1a9ee79d96f198e.camel@surriel.com> <20180831213138.GA9159@tower.DHCP.thefacebook.com> <20180903182956.GE15074@dhcp22.suse.cz> <20180903202803.GA6227@castle.DHCP.thefacebook.com> <20180904070005.GG14951@dhcp22.suse.cz> <20180904153445.GA22328@tower.DHCP.thefacebook.com> <20180904161431.GP14951@dhcp22.suse.cz> <20180904175243.GA4889@tower.DHCP.thefacebook.com> <20180904180631.GR14951@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180904180631.GR14951@dhcp22.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [now CC Vladimir for real] On Tue 04-09-18 20:06:31, Michal Hocko wrote: > On Tue 04-09-18 10:52:46, Roman Gushchin wrote: > > On Tue, Sep 04, 2018 at 06:14:31PM +0200, Michal Hocko wrote: > [...] > > > I am not opposing your patch but I am trying to figure out whether that > > > is the best approach. > > > > I don't think the current logic does make sense. Why should cgroups > > with less than 4k kernel objects be excluded from being scanned? > > How is it any different from the the LRU reclaim? Maybe it is just not > that visible because there usually more pages there. But in principle it > is the same issue AFAICS. > > > Reparenting of all pages is definitely an option to consider, > > but it's not free in any case, so if there is no problem, > > why should we? Let's keep it as a last measure. In my case, > > the proposed patch works perfectly: the number of dying cgroups > > jumps around 100, where it grew steadily to 2k and more before. > > Let me emphasise that I am not opposing the patch. I just think that we > have made some decisions which are not ideal but I would really like to > prevent from building workarounds on top. If we have to reconsider some > of those decisions then let's do it. Maybe the priority scaling is just > too coarse and what seem to work work for normal LRUs doesn't work for > shrinkers. > > > I believe that reparenting of LRU lists is required to minimize > > the number of LRU lists to scan, but I'm not sure. > > Well, we do have more lists to scan for normal LRUs. It is true that > shrinkers add multiplining factor to that but in principle I guess we > really want to distinguish dead memcgs because we do want to reclaim > those much more than the rest. Those objects are basically of no use > just eating resources. The pagecache has some chance to be reused at > least but I fail to see why we should keep kernel objects around. Sure, > some of them might be harder to reclaim due to different life time and > internal object management but this doesn't change the fact that we > should try hard to reclaim those. So my gut feeling tells me that we > should have a way to distinguish them. > > Btw. I do not see Vladimir on the CC list. Added (the thread starts > here http://lkml.kernel.org/r/20180831203450.2536-1-guro@fb.com) -- Michal Hocko SUSE Labs