Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2718051rwd; Mon, 22 May 2023 03:20:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7anaqn4rjqytNYR50w+kzr3+41SkiTPk5EbXPFyOuIraTOUexk7Fpio/GAPgzsD9UQiQnc X-Received: by 2002:a05:6a20:3945:b0:10b:1c98:59b6 with SMTP id r5-20020a056a20394500b0010b1c9859b6mr5830218pzg.14.1684750810116; Mon, 22 May 2023 03:20:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684750810; cv=none; d=google.com; s=arc-20160816; b=xiTECyuA6s0x5ol4S0klTkjaZn10QCgAfHThknKsvtW/8X67DCkr4ywiiVSs0i6Oby wPxL1PGg/R/NtxHrN3eer5KmRw5bhsCpoiiTqX3Ta/h+RQ0XtPMsO/4DrsUqJHoypYWB oNLMorIc9UdAW+AHA06U/S4kqqoAgcoH+dSXYuXANdH0tKBCmeXkpnl4MzT+lVgUQtpD 2qcmKcrHJ7tJlpXE1nbnoNrZUeKW5KmcCHjNMavGuAN/XcI+tc9hPHtX1gnfdoGN5tox b9hdyCbGHDAYJzo4vyGnEFm9fM975zIBV0y8VXT4BnwO1MdBrCExKRYlEbcgDcS+i7Fn CxGQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x26-20020aa7941a000000b0063b76333d9asi4515951pfo.217.2023.05.22.03.19.57; Mon, 22 May 2023 03:20:10 -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 S232265AbjEVJx0 (ORCPT + 99 others); Mon, 22 May 2023 05:53:26 -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 ); 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 ; Mon, 22 May 2023 02:53:23 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-64d247a023aso2875797b3a.2 for ; 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 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 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: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- tools/testing/selftests/cgroup/test_memcontrol.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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))) -- 2.25.1