Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2454365rwo; Thu, 3 Aug 2023 09:34:02 -0700 (PDT) X-Google-Smtp-Source: APBJJlEcyUTn2KH7s3e0Mw/yI2oqzkXNnL/1HUf7dtnz/TdPx8wNRgyu5ADvx6rrYoYLBnxduNb7 X-Received: by 2002:a17:902:8f97:b0:1b8:7618:5414 with SMTP id z23-20020a1709028f9700b001b876185414mr14523278plo.60.1691080442376; Thu, 03 Aug 2023 09:34:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691080442; cv=none; d=google.com; s=arc-20160816; b=NuYQkGl05G2gkHG9CjQmuiuaFk5CHGTIJU989rwcg/oVNYwpejO974Hu8eYZAHXS/7 P/Xk3sjltMkHPX+koVftC17k9KASWAdX9ZhJ/KtQfG4ffY7mr75BPRkhCQTVG+4KEwte HOhofkkoD4VQg0j0syRDUarapdddVV3sHAtn1iBdxVVlK7nSpH3Uias43x9jECWSjiOw aQF2bgvq4043nxAKrEHl+91hRYSvQx0MKx+58N6Eej/epguGwTMwqMMHk01DjdhfyC4D 79o0dmKA+YKAA1AUpVy56HIl/vndc2BTLjfR8u6A8Rx+jYBBz7ThmjKpi8HA90pF2zGy M/yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=cwXRj1KBICVmDyXNwF6/K1df3vGE/T6x9GRpnMzQtuM=; fh=RzmXsDivjWdsonpBtYWh3IviiAgV41mnHvoDUgWK5Fs=; b=jjTJAwG3bS4+SvucB71OaBxVWcb03Sb9+T990cystYI8rzI9b15pO5CBgQvy4fQnMI qB+3eCaxe0l6rx4GD9kuEsETfGl3EIhvdE3k0TzAYGVZe6WJaoikNobVrEI+GHvnaAHI /JNJrzDN2+T7H2PEGStWCNm30Dz5RJl4/Vx8k/dvZKjSvndplogzIcHqr8nQszIXIfBj 0dqwRiCZzpVxtcsRVm+SwwcXBlNRecZMF81eJBFgzFKZjUmmcsxfi/6uX64fM7cSkUS8 9nwrHQ4ePFumKhqJa1q2nhLbEy+uZFS/Z2QaWhv/9RkVq2vMz54T32AMMit7kIsfsPmw Q4JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fXfuTyl9; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i1-20020a170902e48100b001bbbb70c23asi120085ple.232.2023.08.03.09.33.48; Thu, 03 Aug 2023 09:34:02 -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=@redhat.com header.s=mimecast20190719 header.b=fXfuTyl9; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235038AbjHCQCL (ORCPT + 99 others); Thu, 3 Aug 2023 12:02:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237332AbjHCQB6 (ORCPT ); Thu, 3 Aug 2023 12:01:58 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2C773C01 for ; Thu, 3 Aug 2023 09:01:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691078459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=cwXRj1KBICVmDyXNwF6/K1df3vGE/T6x9GRpnMzQtuM=; b=fXfuTyl9529XxoXuRK1mBvY3jcrxrtPpo+yFmuET/VL2QOqPRAu1A9YoOkE6eWBrS5OL19 h/k77UDupzGe7rCKuwh+WyBDBtY8AWkkMIj/Vx2Uonc/KucOrYzpsI7ioE+RInu/hraBFu PCzyPk9XivrdzH22N0cuGzDoQ1sADHs= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-63--8sjxjEkN7KDmzvvTrGQ1g-1; Thu, 03 Aug 2023 12:00:58 -0400 X-MC-Unique: -8sjxjEkN7KDmzvvTrGQ1g-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-63d245b67abso11438146d6.3 for ; Thu, 03 Aug 2023 09:00:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691078458; x=1691683258; h=user-agent:content-disposition:mime-version:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cwXRj1KBICVmDyXNwF6/K1df3vGE/T6x9GRpnMzQtuM=; b=U47QA3dFiFtzuH/OLi4d2ULu1dSs8KQFV90SkkCeG/7f32cidSciKP703Y+Lk8rm2P EIJKId9BauB3aBwK8pQiwM3gsSyeZtlLEskQkEF1RHbU/7vFv/DKftsxn6mOCSkoaapU iJOYJ81OZS+moTF0P6taPnu7rYMBfK0x1WMUpuhiT9Rbc7qU2e1sfkKJGK48ieWfhaXw I+qVnAmXiixB6rOF0fC0jcOc5/2bT6W32qc7NDjTUn4UzbplrBZk4w+bU7sIvvaKvX0y IDz4EZWrJ1OHUB+bDEWbUh1MkGLYLQ/x05iZDWNMb8sOBkYNa1Yv+G8F/VG95aV13MYD WEdg== X-Gm-Message-State: ABy/qLZlkl+6kps7QZrYEHiBXV2aOt5wuDc/xzvILyynCIVdyFyk5/FD nNiBVjYF9Ra++qEc/g7edER0nYv+PbdKSiTdNcr+l2WhM1I1fXDWLZzsAz56VEIxZqQkp7FHqfs NJGkJNkHeJ4TLVO1t7RniOQ4P X-Received: by 2002:a0c:cb86:0:b0:63d:b75:c971 with SMTP id p6-20020a0ccb86000000b0063d0b75c971mr19142303qvk.15.1691078457937; Thu, 03 Aug 2023 09:00:57 -0700 (PDT) X-Received: by 2002:a0c:cb86:0:b0:63d:b75:c971 with SMTP id p6-20020a0ccb86000000b0063d0b75c971mr19142272qvk.15.1691078457517; Thu, 03 Aug 2023 09:00:57 -0700 (PDT) Received: from fedora ([174.89.37.244]) by smtp.gmail.com with ESMTPSA id w19-20020a0cdf93000000b0062de6537febsm2729qvl.58.2023.08.03.09.00.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 09:00:57 -0700 (PDT) Date: Thu, 3 Aug 2023 12:00:47 -0400 From: Lucas Karpinski To: Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Tejun Heo , Zefan Li , Shuah Khan Cc: Muchun Song , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] selftests: cgroup: fix test_kmem_basic slab1 check Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: NeoMutt/20230517 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE,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 test_kmem_basic creates 100,000 negative dentries, with each one mapping to a slab object. After memory.high is set, these are reclaimed through the shrink_slab function call which reclaims all 100,000 entries. The test passes the majority of the time because when slab1 is calculated, it is often above 0, however, 0 is also an acceptable value. Signed-off-by: Lucas Karpinski --- https://lore.kernel.org/all/m6jbt5hzq27ygt3l4xyiaxxb7i5auvb2lahbcj4yaxxigqzu5e@5rn6s2yjzv7u/ V2: Corrected title tools/testing/selftests/cgroup/test_kmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/cgroup/test_kmem.c b/tools/testing/selftests/cgroup/test_kmem.c index 258ddc565deb..ba0a0bfc5a98 100644 --- a/tools/testing/selftests/cgroup/test_kmem.c +++ b/tools/testing/selftests/cgroup/test_kmem.c @@ -71,7 +71,7 @@ static int test_kmem_basic(const char *root) cg_write(cg, "memory.high", "1M"); slab1 = cg_read_key_long(cg, "memory.stat", "slab "); - if (slab1 <= 0) + if (slab1 < 0) goto cleanup; current = cg_read_long(cg, "memory.current"); -- 2.41.0