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=-2.5 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 0A809CA9EA0 for ; Tue, 22 Oct 2019 13:58:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C9EA02184C for ; Tue, 22 Oct 2019 13:58:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C9EA02184C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 55A7B6B0003; Tue, 22 Oct 2019 09:58:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4E2E06B0006; Tue, 22 Oct 2019 09:58:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 383466B0007; Tue, 22 Oct 2019 09:58:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0144.hostedemail.com [216.40.44.144]) by kanga.kvack.org (Postfix) with ESMTP id 11C5F6B0003 for ; Tue, 22 Oct 2019 09:58:36 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id B447A180AD817 for ; Tue, 22 Oct 2019 13:58:35 +0000 (UTC) X-FDA: 76071575790.28.week30_681ae65dd3d5d X-HE-Tag: week30_681ae65dd3d5d X-Filterd-Recvd-Size: 3262 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Tue, 22 Oct 2019 13:58:35 +0000 (UTC) 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 D7513B444; Tue, 22 Oct 2019 13:58:33 +0000 (UTC) Date: Tue, 22 Oct 2019 15:58:32 +0200 From: Michal Hocko To: Hillf Danton Cc: linux-mm , Andrew Morton , linux-kernel , Chris Down , Tejun Heo , Roman Gushchin , Johannes Weiner , Shakeel Butt , Matthew Wilcox , Minchan Kim , Mel Gorman Subject: Re: [RFC v1] memcg: add memcg lru for page reclaiming Message-ID: <20191022135832.GR9379@dhcp22.suse.cz> References: <20191021115654.14740-1-hdanton@sina.com> <20191022133050.15620-1-hdanton@sina.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191022133050.15620-1-hdanton@sina.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue 22-10-19 21:30:50, Hillf Danton wrote: > > On Mon, 21 Oct 2019 14:14:53 +0200 Michal Hocko wrote: > > > > On Mon 21-10-19 19:56:54, Hillf Danton wrote: > > > > > > Currently soft limit reclaim is frozen, see > > > Documentation/admin-guide/cgroup-v2.rst for reasons. > > > > > > Copying the page lru idea, memcg lru is added for selecting victim > > > memcg to reclaim pages from under memory pressure. It now works in > > > parallel to slr not only because the latter needs some time to reap > > > but the coexistence facilitates it a lot to add the lru in a straight > > > forward manner. > > > > This doesn't explain what is the problem/feature you would like to > > fix/achieve. It also doesn't explain the overall design. > > 1, memcg lru makes page reclaiming hierarchy aware Is that a problem statement or a design goal? > While doing the high work, memcgs are currently reclaimed one after > another up through the hierarchy; Which is the design because it is the the memcg where the high limit got hit. The hierarchical behavior ensures that the subtree of that memcg is reclaimed and we try to spread the reclaim fairly over the tree. > in this RFC after ripping pages off > the first victim, the work finishes with the first ancestor of the victim > added to lru. > > Recaliming is defered until kswapd becomes active. This is a wrong assumption because high limit might be configured way before kswapd is woken up. > 2, memcg lru tries much to avoid overreclaim Again, is this a problem statement or a design goal? > Only one memcg is picked off lru in FIFO mode under memory pressure, > and MEMCG_CHARGE_BATCH pages are reclaimed one memcg at a time. And why is this preferred over SWAP_CLUSTER_MAX and whole subtree reclaim that we do currently? Please do not set another version until it is actually clear what you want to achieve and why. -- Michal Hocko SUSE Labs