Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1602107pxb; Wed, 20 Oct 2021 08:16:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGeLFasc76K9ydyfqnughkGdslsb3olyZPHPtn5Oi4JGjnCkNjh3U6HGhiuSlJG6A63Iub X-Received: by 2002:a17:906:6bce:: with SMTP id t14mr183796ejs.546.1634742960648; Wed, 20 Oct 2021 08:16:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634742960; cv=none; d=google.com; s=arc-20160816; b=jiYHiBvdnKQPgOqutZJdOeoy3ZXYlShW18mBEW8zrzYrJab6afOlqeQHn4oUJ/j9BJ CfephHrELtDT0adiiBHFokNA0tkAdFANemWO8OzN2ltpGS4auIhL5Ijsx4CJWz2mQ7Hs Uhgh9S5+eCpU2d9kFywJQLS+pL3WyZ2nzFOP/wT+//jNBJsPqYlvyweRj278POMcI/Tl +a6oLwFG4Ay8A37PgT/HWs0DqIBCHStAaO0YNTDc0rERrFVrdhIJPtcmkCvb9uElJmzN GOEGJF0AN+L/3u/7wcHDDiBbO/mTXYG5eHmVHdEAR23Cv7g96khtvGz+dMiVGtTzw9vX A8Cg== 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=4phKG3v7AhqVm7wB1hnWNwhQ3pm7190f563uVsyAUGU=; b=qooY7Wsekl9qpLfArvk8SHBt/serboG+pzpBn9xnhpM+QWSspSUGcvXjiC4UD2ySV8 A+6/MVIKV5/MaUEXJA0FJMUL4pDNwQ2GJD7heqe1D3TF1kvw2c+Njiev9FenDn0UKzl7 zLiKhbqK4G+kJFn+jY+fuhWTi1t1+0aVCiEGVPgJbDqj6KGD8k4xM6Nx2it+US1YdW7T di405Jv0m92BUNH+puWUC8uEQdky4NY46FjmcGH2q6dcANfkPthjklB8+BWKyGXndQOS bPkyyrd520EtrcAIrhdgc2NMJFEoH3dSUAqL88gUjikn1hRmB4ThosGB4ZagxKCRMZn+ Ot8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=XCs3VtZU; 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 m8si3033668eda.236.2021.10.20.08.15.33; Wed, 20 Oct 2021 08:16: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=XCs3VtZU; 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 S229570AbhJTPNe (ORCPT + 99 others); Wed, 20 Oct 2021 11:13:34 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:41910 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230349AbhJTPNd (ORCPT ); Wed, 20 Oct 2021 11:13:33 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 62EA721940; Wed, 20 Oct 2021 15:11:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1634742675; 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=4phKG3v7AhqVm7wB1hnWNwhQ3pm7190f563uVsyAUGU=; b=XCs3VtZUJyt68k3+ZF1yH49d+mFBf7wGBPfvDt0szjmCz8LijBJGR4ZDBQ50t96D0bRPgV 1rZrUwv5M9sS6dUKny9EqtlX4dX8LkvxKBcLNCB/ANcLa2oOl2fQ86Mcbta9VuQNiMFR80 4VwKlvx9coxtqMG6rSk9AV74CvbX9wU= 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 0456BA3B87; Wed, 20 Oct 2021 15:11:10 +0000 (UTC) Date: Wed, 20 Oct 2021 17:11:02 +0200 From: Michal Hocko To: Zhaoyang Huang Cc: Andrew Morton , Johannes Weiner , Vladimir Davydov , Zhaoyang Huang , "open list:MEMORY MANAGEMENT" , LKML Subject: Re: [PATCH] mm: skip current when memcg reclaim Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 20-10-21 19:45:33, Zhaoyang Huang wrote: > On Wed, Oct 20, 2021 at 4:55 PM Michal Hocko wrote: > > > > On Wed 20-10-21 15:33:39, Zhaoyang Huang wrote: > > [...] > > > Do you mean that direct reclaim should succeed for the first round > > > reclaim within which memcg get protected by memory.low and would NOT > > > retry by setting memcg_low_reclaim to true? > > > > Yes, this is the semantic of low limit protection in the upstream > > kernel. Have a look at do_try_to_free_pages and how it sets > > memcg_low_reclaim only if there were no pages reclaimed. > > > > > It is not true in android > > > like system, where reclaim always failed and introduce lmk and even > > > OOM. > > > > I am not familiar with android specific changes to the upstream reclaim > > logic. You should be investigating why the reclaim couldn't make a > > forward progress (aka reclaim pages) from non-protected memcgs. There > > are tracepoints you can use (generally vmscan prefix). > Ok, I am aware of why you get confused now. I think you are analysing > cgroup's behaviour according to a pre-defined workload and memory > pattern, which should work according to the design, such as processes > within root should provide memory before protected memcg get > reclaimed. You can refer [1] as the hierarchy, where effective > userspace workloads locate in protect groups and have rest of > processes be non-grouped. In fact, non-grouped ones can not provide > enough memory as they are kernel threads and the processes with few > pages on LRU(control logic inside). The practical scenario is groupA > launched a high-order kmalloc and introduce reclaiming(kswapd and > direct reclaim). As I said, non-grouped ones can not provide enough > contiguous memory blocks which let direct reclaim quickly fail for the > first round reclaiming. What I am trying to do is that let kswapd try > more for the target. It is also fair if groupA,B,C are trapping in > slow path concurrently. > > [1] > root > | | > | | > non-grouped processes groupA groupB groupC I am sorry but I still do not understand your setup. I have asked several times for more specifics. Without that I cannot really wrap my head around your (ever changing) statements. This is not really a productive use of time. I am sorry but I cannot really help you much without understanding the actual problem. -- Michal Hocko SUSE Labs