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 EF4BEC433F5 for ; Fri, 13 May 2022 19:15:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2194D6B0078; Fri, 13 May 2022 15:15:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C9016B007B; Fri, 13 May 2022 15:15:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 06A2E6B007D; Fri, 13 May 2022 15:15:04 -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 EB93B6B0078 for ; Fri, 13 May 2022 15:15:03 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id B7F8420DAF for ; Fri, 13 May 2022 19:15:03 +0000 (UTC) X-FDA: 79461672486.20.D724EB5 Received: from mail-qv1-f44.google.com (mail-qv1-f44.google.com [209.85.219.44]) by imf22.hostedemail.com (Postfix) with ESMTP id 16BCEC00C0 for ; Fri, 13 May 2022 19:15:00 +0000 (UTC) Received: by mail-qv1-f44.google.com with SMTP id h13so7393547qvh.0 for ; Fri, 13 May 2022 12:15:02 -0700 (PDT) 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:user-agent; bh=p574xXlGBpc8qZHyt2pwHHSkpjniuBS9UHrRl2xc4Cc=; b=d4yMErjIqL+m7lcBm1ePQwvvbQFS9OqGAwBr0bWs2gYnRKY4gVq1JbI6E3cwafASKC U6WLiLoCsLQRySRgsIHltvfVRA5E2RX/HuxE2+1qYJvj4cXcAdwVPcKFvDvUi76iVT2d AC6xIEGx+AajtMZq8eHcRaQBGkXcxaQhnk6DJkehyhQHivgH7ZL3j0ZTftAs8/okVl21 QxfvQAeOJkHS5Xm/amiWpI+WMnV/arVT6Mbj8B15S8wfu1bCbSw0lYqWakIEqD3dDvDz 6HiORSmGZp/QaRrGYQuGYJAWnmCQIsEg5dZwOrP+VTFOM923RYDpFCwY/M+uxart9jIR lQ0g== X-Gm-Message-State: AOAM532Qx/tQvrTbypp1yiqkkFkSNbGUSXWeNWtntgedLSOs+nro7W1s LI6VMoOk9xMTLtPj77wG3UM= X-Google-Smtp-Source: ABdhPJw5uIPwsI4RjyLfr/Fa/my7GiG+kuUc1zYJNDotGR+vRVn8xO8+UAzQLi7VVzplQLRinRiIZg== X-Received: by 2002:a05:6214:21aa:b0:461:b0d9:b265 with SMTP id t10-20020a05621421aa00b00461b0d9b265mr2743723qvc.110.1652469302072; Fri, 13 May 2022 12:15:02 -0700 (PDT) Received: from dev0025.ash9.facebook.com (fwdproxy-ash-004.fbsv.net. [2a03:2880:20ff:4::face:b00c]) by smtp.gmail.com with ESMTPSA id t11-20020ac8760b000000b002f39b99f694sm1884975qtq.46.2022.05.13.12.15.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 12:15:01 -0700 (PDT) Date: Fri, 13 May 2022 12:14:59 -0700 From: David Vernet To: Michal =?utf-8?Q?Koutn=C3=BD?= Cc: akpm@linux-foundation.org, cgroups@vger.kernel.org, hannes@cmpxchg.org, kernel-team@fb.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, mhocko@kernel.org, roman.gushchin@linux.dev, shakeelb@google.com, tj@kernel.org, Richard Palethorpe Subject: Re: [PATCH 4/4] selftests: memcg: Remove protection from top level memcg Message-ID: <20220513191459.qgnmnu62xgxvhx5z@dev0025.ash9.facebook.com> References: <20220512174452.tr34tuh4k5jm6qjs@dev0025.ash9.facebook.com> <20220513171811.730-1-mkoutny@suse.com> <20220513171811.730-5-mkoutny@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220513171811.730-5-mkoutny@suse.com> User-Agent: NeoMutt/20211029 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 16BCEC00C0 X-Stat-Signature: q4yfqgzsu9rfyhfx5jffdm9dbcccnjbd Authentication-Results: imf22.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf22.hostedemail.com: domain of dcvernet@gmail.com designates 209.85.219.44 as permitted sender) smtp.mailfrom=dcvernet@gmail.com X-Rspam-User: X-HE-Tag: 1652469300-749151 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, May 13, 2022 at 07:18:11PM +0200, Michal Koutný wrote: > The reclaim is triggered by memory limit in a subtree, therefore the > testcase does not need configured protection against external reclaim. > > Also, correct/deduplicate respective comments > > Signed-off-by: Michal Koutný > --- > tools/testing/selftests/cgroup/test_memcontrol.c | 12 ++++-------- > 1 file changed, 4 insertions(+), 8 deletions(-) > > diff --git a/tools/testing/selftests/cgroup/test_memcontrol.c b/tools/testing/selftests/cgroup/test_memcontrol.c > index 9ffacf024bbd..9d370aafd799 100644 > --- a/tools/testing/selftests/cgroup/test_memcontrol.c > +++ b/tools/testing/selftests/cgroup/test_memcontrol.c > @@ -247,7 +247,7 @@ static int cg_test_proc_killed(const char *cgroup) > > /* > * First, this test creates the following hierarchy: > - * A memory.min = 50M, memory.max = 200M > + * A memory.min = 0, memory.max = 200M > * A/B memory.min = 50M, memory.current = 50M > * A/B/C memory.min = 75M, memory.current = 50M > * A/B/D memory.min = 25M, memory.current = 50M > @@ -257,7 +257,7 @@ static int cg_test_proc_killed(const char *cgroup) > * Usages are pagecache, but the test keeps a running > * process in every leaf cgroup. > * Then it creates A/G and creates a significant > - * memory pressure in it. > + * memory pressure in A. > * > * A/B memory.current ~= 50M > * A/B/C memory.current ~= 29M > @@ -335,8 +335,6 @@ static int test_memcg_min(const char *root) > (void *)(long)fd); > } > > - if (cg_write(parent[0], "memory.min", "50M")) > - goto cleanup; > if (cg_write(parent[1], "memory.min", "50M")) > goto cleanup; > if (cg_write(children[0], "memory.min", "75M")) > @@ -404,8 +402,8 @@ static int test_memcg_min(const char *root) > > /* > * First, this test creates the following hierarchy: > - * A memory.low = 50M, memory.max = 200M > - * A/B memory.low = 50M, memory.current = 50M > + * A memory.low = 0, memory.max = 200M > + * A/B memory.low = 50M, memory.current = ... Is there a reason that we would adjust this comment but not the A/B comment from above in from test_memcg_low()? In both cases, I would just remove the memory.current = ... part altogether, as Roman suggested. > * A/B/C memory.low = 75M, memory.current = 50M > * A/B/D memory.low = 25M, memory.current = 50M > * A/B/E memory.low = 0, memory.current = 50M > @@ -490,8 +488,6 @@ static int test_memcg_low(const char *root) > goto cleanup; > } > > - if (cg_write(parent[0], "memory.low", "50M")) > - goto cleanup; > if (cg_write(parent[1], "memory.low", "50M")) > goto cleanup; > if (cg_write(children[0], "memory.low", "75M")) > -- > 2.35.3 > Looks good otherwise. Reviewed-by: David Vernet