Message ID | 20230522095233.4246-2-haifeng.xu@shopee.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1335581vqo; Mon, 22 May 2023 03:12:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4uNZMjK/Y5k0jOvSfTCjWAdXt81wjfB1OnNHtDIiPujYt3tY1pHFyI8uKmi4H29bzsdvf+ X-Received: by 2002:a05:6a00:1486:b0:645:d02d:9a83 with SMTP id v6-20020a056a00148600b00645d02d9a83mr14557984pfu.17.1684750362443; Mon, 22 May 2023 03:12:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684750362; cv=none; d=google.com; s=arc-20160816; b=sMJEY23uMJJa40RBOa6VXE08kdD9ja3gTAR/T2awrZyOdVhu3a0N/Mq/pgnVOSIgQg Fx2VRB/QOpnpVRhfaNAeIGB4EuWxGS6UpZ5aJUv0I4kb39rzqQHDoPDPPGON/wh4RWAW 7WJd61WU9HKcPYRcqejDGVwyuzg7cLuEtD2uf4bYxxLdMhExdwGnagkEIXRNVOdPYLq7 rcE5D3+fdKKRa9qmcb6sLsODqZANMJiZSPUnpRYypK4ck5CImhoH6BYJAZSPSWoeU7Gu vQVL3VJ8+0xYTEQ1pL809oQvaC+Oe/G6Qb+PMyiuWeM3gxwN4oADfsPqp+waRdhJKAQO zrTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=hnIfipm8ADmVcPlfJeR2m6dzYHlF2xT+Sv9iRF6t3cY=; b=ehVfOsbzCR4LsDjExi6mFlb5KE1K5OhEOyB5R+R/QWJNAmmQIMM/QYz3Zfmwbv571F 5VXMp+gD8hdM+jY4VUOduDJKDvQidoiIu6lD80AGfhOpo/5JYXXeVLAPESpaf71yLWTT kHbUAbDJ3nyLCPtM8TqZ0UOz3e0q0+lLu57uM/2wTq9oMDatRVdU3aGxK5yvpZNElNwB fERlWc7aLHFRw1SlRnfE6FfBTtm1P7yLzG4Xy6tAgqoGUoV91UhSa8AAtC97cwmB72z3 RnOZHlHMsY67hzH8cahisxzQYPhs9aV8EfeAXgWc8XQbwyIJIg62Gn4+rKTNAaXntGD+ QSRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shopee.com header.s=shopee.com header.b="AOzpCt/R"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=shopee.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j9-20020a633c09000000b0053074c54c3fsi1274685pga.868.2023.05.22.03.12.30; Mon, 22 May 2023 03:12:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@shopee.com header.s=shopee.com header.b="AOzpCt/R"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=shopee.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232660AbjEVJx1 (ORCPT <rfc822;cscallsign@gmail.com> + 99 others); Mon, 22 May 2023 05:53:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231872AbjEVJxY (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 22 May 2023 05:53:24 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C097B9 for <linux-kernel@vger.kernel.org>; Mon, 22 May 2023 02:53:23 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-64d247a023aso2875797b3a.2 for <linux-kernel@vger.kernel.org>; Mon, 22 May 2023 02:53:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shopee.com; s=shopee.com; t=1684749203; x=1687341203; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=hnIfipm8ADmVcPlfJeR2m6dzYHlF2xT+Sv9iRF6t3cY=; b=AOzpCt/R5/HiWo6POXCM45SpS08bNlo11NcaKUQY8fbE74t46SQzwFReeowIfN1QBH k42Pa4PS1GDGK68evYz8AKEVOtCHJrI1Ycb8tBHltfRKXUCfVX1cpN31oU4AKAUV/v3b atvu/X/oySVxlD9Eqt4fOQR6IS55Z8JZhWRWfm2AikBq/n8wh3FmecrWs6Y5Ev6ljHfQ u2sjZwIfVdOOAmurBV6Mx3WGS2fliHR2vLyTGHn7M5FHSLYPQ+zCv1C2h3ehMN+xzzZF 3022G70xrM3eiXml5jDArQFZrTLKq5hqXeoebTIw7Z+yxmB0sA3rMeGeSB+1U4Ak/wmv Xm/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684749203; x=1687341203; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hnIfipm8ADmVcPlfJeR2m6dzYHlF2xT+Sv9iRF6t3cY=; b=LfYvFrc06WRb0Vol1sZy1cmQxLXSCGpo0+blWVWXnHq4ugWbHlPxPMkUY+0oC9WItl Ns5w0/0yLy9/z/qaWkbB1B7tH1W+OBi46wH/3hFB0lTexJmQ+pvJI4fB14rNk3YX22NT 26NEcpKBdvOdiSPqaNZXMF6dyRFAagUTfbIdYIhJdfIamJYolrnqdEwIC1jzONktvGzY yTRdOFYqyvs9h+gRgjfxhDl0Yg550erE0a/BUY9+xKcYz0I1hnJA3Hg5n1mIKLHEdrha L/grrWhezbtBeuac03/2bnckUdLXfps29zGQyGyoRUHuqHCQEM+j5GRkWotaiVgJe52c rgVQ== X-Gm-Message-State: AC+VfDyeaHoyhym392R1IX2I1Dz7NgxwxAAzQuRc/wUpK3vNWzz7txcq RBdVyxdhOyMeLoUeGrxfCCwJeA== X-Received: by 2002:a05:6a20:8e07:b0:104:62a9:9006 with SMTP id y7-20020a056a208e0700b0010462a99006mr12512823pzj.36.1684749202957; Mon, 22 May 2023 02:53:22 -0700 (PDT) Received: from ubuntu-hf2.default.svc.cluster.local ([101.127.248.173]) by smtp.gmail.com with ESMTPSA id g37-20020a632025000000b0051b9e82d6d6sm4089267pgg.40.2023.05.22.02.53.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 02:53:22 -0700 (PDT) From: Haifeng Xu <haifeng.xu@shopee.com> To: mhocko@kernel.org Cc: roman.gushchin@linux.dev, hannes@cmpxchg.org, shakeelb@google.com, akpm@linux-foundation.org, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Haifeng Xu <haifeng.xu@shopee.com> Subject: [PATCH 2/2] selftests: cgroup: fix unexpected failure on test_memcg_low Date: Mon, 22 May 2023 09:52:33 +0000 Message-Id: <20230522095233.4246-2-haifeng.xu@shopee.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766588795976968121?= X-GMAIL-MSGID: =?utf-8?q?1766588795976968121?= |
Series |
[1/2] mm/memcontrol: fix typo in comment
|
|
Commit Message
Haifeng Xu
May 22, 2023, 9:52 a.m. UTC
Since commit f079a020ba95 ("selftests: memcg: factor out common parts
of memory.{low,min} tests"), the value used in second alloc_anon has
changed from 148M to 170M. Because memory.low allows reclaiming page
cache in child cgroups, so the memory.current is close to 30M instead
of 50M. Therefore, adjust the expected value of parent cgroup.
Fixes: f079a020ba95 ("selftests: memcg: factor out common parts of memory.{low,min} tests")
Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com>
---
tools/testing/selftests/cgroup/test_memcontrol.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Comments
On Mon, May 22, 2023 at 09:52:33AM +0000, Haifeng Xu <haifeng.xu@shopee.com> wrote: > Since commit f079a020ba95 ("selftests: memcg: factor out common parts > of memory.{low,min} tests"), the value used in second alloc_anon has > changed from 148M to 170M. Because memory.low allows reclaiming page > cache in child cgroups, so the memory.current is close to 30M instead > of 50M. Therefore, adjust the expected value of parent cgroup. > > Fixes: f079a020ba95 ("selftests: memcg: factor out common parts of memory.{low,min} tests") > Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com> > --- > tools/testing/selftests/cgroup/test_memcontrol.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) Yes, the expected value should be complement of the allocation to the limit when reclaim is allowed. Reviewed-by: Michal Koutný <mkoutny@suse.com> FTR, the test_memcg_low fails after the fix still (6.3.1-2-default) because of nonzero memory.events:low in the unprotected A/B/E group (with memory_recursiveprot). (That's another and long standing issues -- perhaps the reason why this issue was hidden.) Thanks, Michal
diff --git a/tools/testing/selftests/cgroup/test_memcontrol.c b/tools/testing/selftests/cgroup/test_memcontrol.c index f4f7c0aef702..a2a90f4bfe9f 100644 --- a/tools/testing/selftests/cgroup/test_memcontrol.c +++ b/tools/testing/selftests/cgroup/test_memcontrol.c @@ -292,6 +292,7 @@ static int test_memcg_protection(const char *root, bool min) char *children[4] = {NULL}; const char *attribute = min ? "memory.min" : "memory.low"; long c[4]; + long current; int i, attempts; int fd; @@ -400,7 +401,8 @@ static int test_memcg_protection(const char *root, bool min) goto cleanup; } - if (!values_close(cg_read_long(parent[1], "memory.current"), MB(50), 3)) + current = min ? MB(50) : MB(30); + if (!values_close(cg_read_long(parent[1], "memory.current"), current, 3)) goto cleanup; if (!reclaim_until(children[0], MB(10)))