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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FE67C433EF for ; Wed, 11 May 2022 17:53:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D1FDA6B0073; Wed, 11 May 2022 13:53:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CCED56B0074; Wed, 11 May 2022 13:53:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B6F276B0075; Wed, 11 May 2022 13:53:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id A93AB6B0073 for ; Wed, 11 May 2022 13:53:08 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 80F8781B11 for ; Wed, 11 May 2022 17:53:08 +0000 (UTC) X-FDA: 79454208456.05.CCC8E2E Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) by imf14.hostedemail.com (Postfix) with ESMTP id 811AA1000A5 for ; Wed, 11 May 2022 17:53:05 +0000 (UTC) Received: by mail-qt1-f175.google.com with SMTP id fu47so2574474qtb.5 for ; Wed, 11 May 2022 10:53:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=+98S328gIXASjWyIOnT/blA4Tt4P6OykWVYnviKs3ME=; b=ZdCacF6byBtXl0QQmIVcjdBoxeabZgc7+C/W2V36nSNHaMGPgCqRtaTvGz6pJBRZow iblsDw9rPzOZJH00cABZEDopiWvSeJIFXA7B6daZ038Ke4gPcoy+14pjwEKB8l9WOdk2 r22vYuPanMwnpackRyxW8GWj08pIuMQlFcJyBYnVFdw4GmG9s1dslt7Igfa9SzYVHoyn h4qjQE4G07yKMl0JjI3iY7EUCMUkFG1IHeT6azlmb0L53M8Y/katJirJbyC74MrmXVsY Sk8boCp6GYKLKRZUT1BdYQVu6Yy5uWLMBFWqw508lYzne1rA3Cewns5YAGuxR9CWY6yb Ol1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=+98S328gIXASjWyIOnT/blA4Tt4P6OykWVYnviKs3ME=; b=QJKldZdUEvWxHqJ7RRdzrTkbqUfF8yHe8eFQasKvk7sblSzAC2xCVY8NDZ1BVc2TVu plhEB3Qu3yjh0dKYjC5vgUSDbgIQxrscz9nfP1hqfbrhMogTIpSZ+pOLp36bHOZrAf8Q t23LC+5Ya+uU9oLXbKGpgVB/SC2dU6C7Rb/vOeIHQ28PQA57m5ZI1ut+RkkuyS1dmsYt MHxWNHLXzGajkGliEee8bkwhf0QAXQ1qOEkZVEngdtLcUEdYfsZwEI7KuO/wfSMet+qj 4UcYQF/RdiXnA+IMDgCIs933vYsjCrYqBjoWNhaj1t6JnvVYMJoMNfOZmoZFYuXGcBRE bq+A== X-Gm-Message-State: AOAM531sopIPeG/P6DRaXrYYr2g2iZUz3Wa3SWAo7W/0h+A4q4OzxlzS uyz0lhxBAnDTFiwYWvVVYpgY1w== X-Google-Smtp-Source: ABdhPJxi4Nl8pTf7fTdo9YDS9qc45Ph/BFwmULDBZVmNVr9oBfAm1mwPvt6MNTWQqTtGl64tD7wXmg== X-Received: by 2002:a05:622a:1982:b0:2f3:b7c1:4426 with SMTP id u2-20020a05622a198200b002f3b7c14426mr25436047qtc.347.1652291586832; Wed, 11 May 2022 10:53:06 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::1:14fe]) by smtp.gmail.com with ESMTPSA id m185-20020a378ac2000000b0069fc13ce24dsm1577060qkd.126.2022.05.11.10.53.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 May 2022 10:53:06 -0700 (PDT) Date: Wed, 11 May 2022 13:53:05 -0400 From: Johannes Weiner To: Michal =?iso-8859-1?Q?Koutn=FD?= Cc: Andrew Morton , David Vernet , tj@kernel.org, roman.gushchin@linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org, mhocko@kernel.org, shakeelb@google.com, kernel-team@fb.com, Richard Palethorpe , Chris Down Subject: Re: [PATCH v2 2/5] cgroup: Account for memory_recursiveprot in test_memcg_low() Message-ID: References: <20220423155619.3669555-1-void@manifault.com> <20220423155619.3669555-3-void@manifault.com> <20220427140928.GD9823@blackbody.suse.cz> <20220429010333.5rt2jwpiumnbuapf@dev0025.ash9.facebook.com> <20220429092620.GA23621@blackbody.suse.cz> <20220506164015.fsdsuv226nhllos5@dev0025.ash9.facebook.com> <20220509174424.e43e695ffe0f7333c187fba8@linux-foundation.org> <20220510174341.GC24172@blackbody.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220510174341.GC24172@blackbody.suse.cz> Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=ZdCacF6b; spf=pass (imf14.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.160.175 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org; dmarc=pass (policy=none) header.from=cmpxchg.org X-Rspam-User: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 811AA1000A5 X-Stat-Signature: wo5jaf6je3eh83y8ckqr3fe9wber5q87 X-HE-Tag: 1652291585-820896 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: Hi Michal, On Tue, May 10, 2022 at 07:43:41PM +0200, Michal Koutný wrote: > On Mon, May 09, 2022 at 05:44:24PM -0700, Andrew Morton wrote: > > So I think we're OK with [2/5] now. Unless there be objections, I'll > > be looking to get this series into mm-stable later this week. > > I'm sorry, I think the current form of the test reveals an unexpected > behavior of reclaim and silencing the test is not the way to go. > Although, I may be convinced that my understanding is wrong. Looking through your demo results again, I agree with you. It's a tiny error, but it compounds and systematically robs the protected group over and over, to the point where its protection becomes worthless - at least in idle groups, which isn't super common but does happen. Let's keep the test as-is and fix reclaim to make it pass ;) > The obvious fix is at the end of this message, it resolves the case I > posted earlier (with memory_recursiveprot), however, it "breaks" > memory.events:low accounting inside recursive children, hence I'm not > considering it finished. (I may elaborate on the breaking case if > interested, I also need to look more into that myself). Can you indeed elaborate on the problem you see with low events? > @@ -2798,13 +2798,6 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc, > > scan = lruvec_size - lruvec_size * protection / > (cgroup_size + 1); > - > - /* > - * Minimally target SWAP_CLUSTER_MAX pages to keep > - * reclaim moving forwards, avoiding decrementing > - * sc->priority further than desirable. > - */ > - scan = max(scan, SWAP_CLUSTER_MAX); IIRC this was added due to premature OOMs in synthetic testing (Chris may remember more details). However, in practice it wasn't enough anyway, and was followed up by f56ce412a59d ("mm: memcontrol: fix occasional OOMs due to proportional memory.low reclaim"). Now, reclaim retries the whole cycle if proportional protection was in place and it didn't manage to make progress. The rounding for progress doesn't seem to matter anymore. So your proposed patch looks like the right thing to do to me. And I would ack it, but please do explain your concerns around low event reporting after it. Thanks!