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 AC73EC433EF for ; Wed, 20 Oct 2021 15:11:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 266036128B for ; Wed, 20 Oct 2021 15:11:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 266036128B 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 9D8BF6B0071; Wed, 20 Oct 2021 11:11:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9624C6B0072; Wed, 20 Oct 2021 11:11:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8017A6B0075; Wed, 20 Oct 2021 11:11:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0221.hostedemail.com [216.40.44.221]) by kanga.kvack.org (Postfix) with ESMTP id 6BE466B0071 for ; Wed, 20 Oct 2021 11:11:17 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 185E4181AEF30 for ; Wed, 20 Oct 2021 15:11:17 +0000 (UTC) X-FDA: 78717154194.24.90338CE Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf11.hostedemail.com (Postfix) with ESMTP id 8C348F0000B3 for ; Wed, 20 Oct 2021 15:11:16 +0000 (UTC) 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: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 8C348F0000B3 X-Stat-Signature: b5nj1zmuhngpbtzkioxdsnyeo6k1b1ey Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=XCs3VtZU; spf=pass (imf11.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-HE-Tag: 1634742676-857018 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 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