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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8041C433EF for ; Sat, 16 Oct 2021 02:58:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3B60C6124B for ; Sat, 16 Oct 2021 02:58:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3B60C6124B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 9B8256B0071; Fri, 15 Oct 2021 22:58:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 968456B0072; Fri, 15 Oct 2021 22:58:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 82DD06B0073; Fri, 15 Oct 2021 22:58:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0072.hostedemail.com [216.40.44.72]) by kanga.kvack.org (Postfix) with ESMTP id 728AF6B0071 for ; Fri, 15 Oct 2021 22:58:44 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 290788249980 for ; Sat, 16 Oct 2021 02:58:44 +0000 (UTC) X-FDA: 78700792968.01.FED3A6F Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf24.hostedemail.com (Postfix) with ESMTP id 6D6CFB0000A1 for ; Sat, 16 Oct 2021 02:58:42 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id AAA8861214; Sat, 16 Oct 2021 02:58:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1634353119; bh=D4kIgZbs8kCfWbV0F4ekpMVNuf0wAaJd9KI7A+0C9WI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CrgGt8Ns1FnRIaBmvBUZnFbbpb2xBZVS2k4jMmxbVuQ9JQyL0ADglaflJ6XG+Bgdn zoeOSrDw5k7ixknnQLtxyS0/aEGw2tVvNJnwIykPKtXnTbcvaf3kdmG+y1VIPMuU17 SE9Jrj6VrZSlWIu6iLUvVa0aHeOUXpGDu6XLjwts= Date: Fri, 15 Oct 2021 19:58:37 -0700 From: Andrew Morton To: Zhaoyang Huang Cc: Johannes Weiner , Michal Hocko , Vladimir Davydov , Zhaoyang Huang , "open list:MEMORY MANAGEMENT" , LKML Subject: Re: [PATCH] mm: skip current when memcg reclaim Message-Id: <20211015195837.4b26e56f984aaa1383ea0335@linux-foundation.org> In-Reply-To: References: <1634278529-16983-1-git-send-email-huangzhaoyang@gmail.com> <20211015130035.aacc18a4d1ee141b306c2272@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 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 6D6CFB0000A1 X-Stat-Signature: sxebhspe5scnnmto98cbdj6qz9xo3w5k Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=CrgGt8Ns; dmarc=none; spf=pass (imf24.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-HE-Tag: 1634353122-586666 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 Sat, 16 Oct 2021 10:28:54 +0800 Zhaoyang Huang wrote: > On Sat, Oct 16, 2021 at 4:00 AM Andrew Morton wrote: > > > > On Fri, 15 Oct 2021 14:15:29 +0800 Huangzhaoyang wrote: > > > > > From: Zhaoyang Huang > > > > > > Sibling thread of the same process could refault the reclaimed pages > > > in the same time, which would be typical in None global reclaim and > > > introduce thrashing. > > > > "None" -> "node", I assume? > > > > > --- a/mm/vmscan.c > > > +++ b/mm/vmscan.c > > > @@ -2841,6 +2841,11 @@ static void shrink_node_memcgs(pg_data_t *pgdat, struct scan_control *sc) > > > sc->memcg_low_skipped = 1; > > > continue; > > > } > > > + /* > > > + * Don't bother current when its memcg is below low > > > + */ > > > > The comment explains what the code is doing, but the code itself > > already does this. Please can we have a comment that explains *why* > > the code is doing this? > We find that the patch help direct reclaiming bail out early and > eliminate page thrashing for some scenarios(etc APP start on android). > The case could be worse if each APP possess a unique memcg(pages on > current's lru are reclaimed more than global reclaim) What I meant was: please redo the patch with a comment which explains "why the code does this", rather than "what the code does". Also, as this is a performance enhancement, it is preferred to have some performance testing results in the changelog.