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=-0.5 required=3.0 tests=FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 3DE88CA9EA0 for ; Tue, 22 Oct 2019 13:31:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 079592053B for ; Tue, 22 Oct 2019 13:31:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 079592053B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AA18E6B0007; Tue, 22 Oct 2019 09:31:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A50C26B000A; Tue, 22 Oct 2019 09:31:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 995246B0007; Tue, 22 Oct 2019 09:31:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0187.hostedemail.com [216.40.44.187]) by kanga.kvack.org (Postfix) with ESMTP id 764006B0007 for ; Tue, 22 Oct 2019 09:31:08 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id E20DD181AF5D3 for ; Tue, 22 Oct 2019 13:31:07 +0000 (UTC) X-FDA: 76071506574.06.plate88_9abbfec89940 X-HE-Tag: plate88_9abbfec89940 X-Filterd-Recvd-Size: 2667 Received: from mail3-163.sinamail.sina.com.cn (mail3-163.sinamail.sina.com.cn [202.108.3.163]) by imf19.hostedemail.com (Postfix) with SMTP for ; Tue, 22 Oct 2019 13:31:06 +0000 (UTC) Received: from unknown (HELO localhost.localdomain)([222.131.72.81]) by sina.com with ESMTP id 5DAF049500008E8C; Tue, 22 Oct 2019 21:31:03 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com X-SMAIL-MID: 57108849283214 From: Hillf Danton To: Michal Hocko Cc: Hillf Danton , 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 Date: Tue, 22 Oct 2019 21:30:50 +0800 Message-Id: <20191022133050.15620-1-hdanton@sina.com> In-Reply-To: <20191021115654.14740-1-hdanton@sina.com> References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 Mon, 21 Oct 2019 14:14:53 +0200 Michal Hocko wrote: >=20 > On Mon 21-10-19 19:56:54, Hillf Danton wrote: > >=20 > > Currently soft limit reclaim is frozen, see > > Documentation/admin-guide/cgroup-v2.rst for reasons. > >=20 > > 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. >=20 > This doesn't explain what is the problem/feature you would like to > fix/achieve. It also doesn't explain the overall design.=20 1, memcg lru makes page reclaiming hierarchy aware While doing the high work, memcgs are currently reclaimed one after another up through the hierarchy; 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. 2, memcg lru tries much to avoid overreclaim 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. In next version, a new function will be added for kswapd to call, void memcg_try_to_free_pages(void) with CONFIG_MEMCG_LRU dropped and mem_cgroup_soft_limit_reclaim() untouched. Thanks Hillf