Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2533960pxb; Sun, 17 Oct 2021 18:07:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDuEgHcLMyR6jAPc4wuylT39Q2JzMXOltvQdTh4/wt7Cj/P1NCA16wMdQNqSgn8tHZ8aHC X-Received: by 2002:a17:906:5805:: with SMTP id m5mr26408368ejq.221.1634519262804; Sun, 17 Oct 2021 18:07:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634519262; cv=none; d=google.com; s=arc-20160816; b=SWJ+E1Gd2t7SZOlicIiG+Ch/YNV9blgQ8wR9VLhKxThBIcS2B7zuJp20J8/YxF0kcK lNTGBewbGA1hpXIhI9Jkf8BZc/ZKWuz3h8i3v43TXVDT0IoG8Q5YKTb4g2B3mam6ICr+ kIfgX5EybaUgNVHj/iOHiYYlHkpzbI1TxKiKbtgs353yekhYIs2aPrGrXA0XM5XfqEed 3Uu/6s1U3Vpwkkh+sAnDm3FlA+0We/4HIEXkhodtTblZlW987kbl2T1kEbSj3L5MDzp6 GJ11l/XlY9w8uZvFm1b6RnecLJuF5OnT9wd8CRHW/EzOuDXFzbQpKWOnlfp94kp1mNLM pZtg== 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=qDE4ZjJ4lRNsGtF59F3l9BBp4upRD1Jpn26qbmvXIO0=; b=MrUEKaa5fl4o41duiUsLVphGVCqEVj8RmVE4n1AMybB1Cv54n0gXvN8Zevf23yFTPa ajSgANtM8VBs6oAxaUUdWvxIRu6Lknb2whtty6vtuR1hlTUZLJHoZ3JMtqZis24SYR4N lHfLOhU/LcZFtensT1ZjWEWf2zNI1UZe1yqU1UJt/P4FIFmoXd/SrKf0/iU0PpxOLY9h 0XFq/buyclXb+XIE7Bsm/r9QargQSmFqp2GR17t8e2Zjma5+2fOXpSz9DrOnlg6F0XRb Nirw1TdevzySimwMTA5Nj0VIsan88PCCqVcHA7rEpfuZ+rd7Qa8nSykfXDYEcwi0Toq6 rmEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=tqe6f2Zi; 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 h20si17697907ejc.757.2021.10.17.18.07.18; Sun, 17 Oct 2021 18:07:42 -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=tqe6f2Zi; 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 S238427AbhJOUCo (ORCPT + 99 others); Fri, 15 Oct 2021 16:02:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:54648 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233148AbhJOUCo (ORCPT ); Fri, 15 Oct 2021 16:02:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F322761151; Fri, 15 Oct 2021 20:00:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1634328037; bh=7V/+1FW4XJaY4Tukrc6cjuQq0Lv0qT3qHWJvILfbP8k=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=tqe6f2Zi5ekP1KVx7FMNoH7GFR2U4AgdYRjpf3rZuEm4kQNWYzvQF0A0m1Mlay9jC ANkaEsNGpddWaZG3ccXGMm+XI+vwIfnBHWjdf8+RQnrbq6m2xOwJfK35WK5UuFR4pm C8DjIm073AXHW7eZJ2T6Fou7k1V1C0MlziFEReU4= Date: Fri, 15 Oct 2021 13:00:35 -0700 From: Andrew Morton To: Huangzhaoyang Cc: Johannes Weiner , Michal Hocko , Vladimir Davydov , Zhaoyang Huang , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: skip current when memcg reclaim Message-Id: <20211015130035.aacc18a4d1ee141b306c2272@linux-foundation.org> In-Reply-To: <1634278529-16983-1-git-send-email-huangzhaoyang@gmail.com> References: <1634278529-16983-1-git-send-email-huangzhaoyang@gmail.com> 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 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? > + if (get_mem_cgroup_from_mm(current->mm) == memcg) > + continue; > memcg_memory_event(memcg, MEMCG_LOW); > }