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 7196AC433EF for ; Sat, 16 Oct 2021 02:58:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4CF2D611C3 for ; Sat, 16 Oct 2021 02:58:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239690AbhJPDAs (ORCPT ); Fri, 15 Oct 2021 23:00:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:39892 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236923AbhJPDAr (ORCPT ); Fri, 15 Oct 2021 23:00:47 -0400 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.