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 D43B0C433F5 for ; Mon, 18 Oct 2021 08:23:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 62B7E610E8 for ; Mon, 18 Oct 2021 08:23:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 62B7E610E8 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id C4336900002; Mon, 18 Oct 2021 04:23:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BF3EC6B0071; Mon, 18 Oct 2021 04:23:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AE1EF900002; Mon, 18 Oct 2021 04:23:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0035.hostedemail.com [216.40.44.35]) by kanga.kvack.org (Postfix) with ESMTP id 9F3F96B006C for ; Mon, 18 Oct 2021 04:23:10 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 55BE9181D303A for ; Mon, 18 Oct 2021 08:23:10 +0000 (UTC) X-FDA: 78708868140.03.D85ECBF Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf02.hostedemail.com (Postfix) with ESMTP id 167B37001A05 for ; Mon, 18 Oct 2021 08:23:07 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id CA5DA21A63; Mon, 18 Oct 2021 08:23:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1634545388; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=n8PkorG0rCUkv4MmnAhqOK1ZEI4Jw++yy8mZkTDdcBY=; b=sTlb8kIYeuTgIr34wxMDBzxeP68T2Me3IN0Kqaeb8v1FEM8eSvdeVjOfUal6BmBGWiEYzi O5k9TSYNI+B0adYIKhT04yHrSwEjzpPEaMZexUFTxL+94zyfC4XNO0Zs3DqmesiQYcpLZs /Pdin1dEmKR/iAR8eBy8LoLB0/U89As= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 60490A3B84; Mon, 18 Oct 2021 08:23:08 +0000 (UTC) Date: Mon, 18 Oct 2021 10:23:07 +0200 From: Michal Hocko To: Huangzhaoyang Cc: Andrew Morton , Johannes Weiner , Vladimir Davydov , Zhaoyang Huang , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: skip current when memcg reclaim Message-ID: References: <1634278529-16983-1-git-send-email-huangzhaoyang@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1634278529-16983-1-git-send-email-huangzhaoyang@gmail.com> X-Rspamd-Queue-Id: 167B37001A05 Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=sTlb8kIY; spf=pass (imf02.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com X-Stat-Signature: cossbdgtr438ampaks1xb8qsyuefdjxd X-Rspamd-Server: rspam05 X-HE-Tag: 1634545387-143811 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 Fri 15-10-21 14:15:29, 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. It is hard to understand what kind of problem you see (ideally along with some numbers) and how the proposed patch addresses that problem Also you are missing Signed-off-by tag (please have a look at Documentation/process/submitting-patches.rst which is much more comprehensive about the process). > --- > mm/vmscan.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index 5199b96..ebbdc37 100644 > --- 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 > + */ > + if (get_mem_cgroup_from_mm(current->mm) == memcg) > + continue; This code is executed when none of memcg in the reclaimed hierarchy could be reclaimed. Low limit is then ignored and this change is tweaking that behavior without any description of the effect. A very vague note about trashing would indicate that you have something like the following A (hiting hard limit) / \ B C Both B and C low limit protected and current task associated with B. As none of the two could be reclaimed due to soft protection yuu prefer to reclaim from C as you do not want to reclaim from the current process as that could reclaim current's working set. Correct? I would be really curious about more specifics of the used hierarchy. Thanks! > memcg_memory_event(memcg, MEMCG_LOW); > } > > -- > 1.9.1 -- Michal Hocko SUSE Labs