Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2610999pxb; Sun, 17 Oct 2021 20:26:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4+/VxUE1vcm5U7HJS8XBbduLhbJ7zFwnBXbmosnnvkat7NZ6tcqMXCmEDkTGIFBuJp7jb X-Received: by 2002:a17:902:788d:b0:13f:7484:ef54 with SMTP id q13-20020a170902788d00b0013f7484ef54mr24934134pll.61.1634527608538; Sun, 17 Oct 2021 20:26:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634527608; cv=none; d=google.com; s=arc-20160816; b=YKNBZPp4AgDFzb/LQK/udft0PSJsborYxg3GulDGt1ysHc/UNffRKYBFGu8Nrbu8Ec GLDHXkUtDpKglxtBEkY1Gpx2hU26O9wl2xrI1E5c/tbVB9FefT5Y0GMieEmCmTYEf+tN JqLqkXiG97RHp05OKqBLBEjGF2YtkZc1kckku0aBTpIaW1Vu91rF5wBZbBTNezrC7Z3N NjgtHNNR9qVHAKbaDi+7qsVKYu4zkjOXhNuoTmwjLKrEcIpSkhnCDeV1j0zx2BiUOZ4x 0Y6NwaNYA0hsCtzRUIWpx3ZV+HIRuWEiFE4R584aa2hpCgpRhHoO4fJb7TkuNXTEqTyc 3s3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=L0A6twZb9ihqrc78lDQzOGPhVp4R03SQC6mV8EiuhzE=; b=y7xKGtW99pSY2q6h8c+6ExtutmLcByEhACptvlcytJJMXkHkL/9puUHcnwHj2OUJBc gLD5mOIEkLYSBbvEubuMBu7avmpaDT6t1/Ofp78a6lUWULU5ouPPgUDeKqOgrLtIZDru VO93TY6M3Q4zVcUchB14qXXlL6e6Qx0TGVM82XsnzXJNYP9B9twPSYsc+4mBQrHMv3zw KAs0ojBSs1wxU4DZJGhQOYe23IPdBdMXpg2NBeRmrgKgNlJnw2WSN1nNgq4Wa6ZExWN0 hZ+kM4mzhnAHz8k1Cp80lt2eb/X5CGjfsWBymJAPjPOSo1vg6VQN1z9cSKp830F5j1uG ukgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=CrgGt8Ns; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j6si10911124pld.440.2021.10.17.20.26.35; Sun, 17 Oct 2021 20:26:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=CrgGt8Ns; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239625AbhJPDAr (ORCPT + 98 others); Fri, 15 Oct 2021 23:00:47 -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.