Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2782824pxb; Mon, 18 Oct 2021 01:32:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgjgZlcJ/6hFhe2yfwp85IR2g3XG/ZNRlkJcF3vcoyuLhTsb7kFKq86bCfPdiDv9rFsk9Y X-Received: by 2002:a17:906:3d62:: with SMTP id r2mr27719359ejf.174.1634545920722; Mon, 18 Oct 2021 01:32:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634545920; cv=none; d=google.com; s=arc-20160816; b=p6gRFr9PzakXRIl8x582OyasmdAYHTjNdyiSfBd3aO5mmVA1YSXF2tEo0NzVhCO1mb he+G4DBpU24fx5+nP0S4ZawGcVieS+b6sjXKYQptrU3vDouRkms/ImuMLHnF79SUGE8I IhamzQBamXCIgbkC4SjXEs0Gx+I9203teTJZnGMFXbpb/xdRIjHGaIUuj3MYaFcbsIKf YNpo+zCvr7uay29CvsDynSSNoJBV35jaEKLFEd8o5/frgyopPFLYMDE2JyjKo/1P01vQ yBu0Mr6q+3s46EvAM9bIS6rFIFy33agTPzjVG/MHxP3yGcgaH50e19ekRwjAjXJ5bJx0 C33Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=n8PkorG0rCUkv4MmnAhqOK1ZEI4Jw++yy8mZkTDdcBY=; b=d8W13buaLp8twkot59WaB7G1LiBwqLSAsnKSB6SbYoLuuJ2ztoSmYYwa+XF066ZEj5 QI+KaIr21D/gumQP2TUbFcqCKfnyDe1UQ48KvRShGtL6KZFzGVgRohlLl/9icSrDa3QV TqWcNqVsgMpOU7FII8/JlcTosgrochYexKCCR9H8hFJ5MKwuTEP0ZuSqUF9bzZ11Eda3 RsKTa8gAyFcdTti5B6Yukj6SZoDwZsrjLiDGFbS/Bt7Z0lYFAFKK/AB77CS2immgXgrY TD4yK6SiXtVVnmDU4UCU/7lmQ62THqcM8QOGeguxR51QNAswsCY6nRAx7LS/l9KFQMTI HNPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=sTlb8kIY; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 17si20341793eja.19.2021.10.18.01.31.37; Mon, 18 Oct 2021 01:32:00 -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=@suse.com header.s=susede1 header.b=sTlb8kIY; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231258AbhJRIZU (ORCPT + 99 others); Mon, 18 Oct 2021 04:25:20 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:37734 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230525AbhJRIZU (ORCPT ); Mon, 18 Oct 2021 04:25:20 -0400 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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