From patchwork Thu Aug 3 16:00:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Karpinski X-Patchwork-Id: 13340286 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 98CECEB64DD for ; Thu, 3 Aug 2023 16:01:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 02C76280279; Thu, 3 Aug 2023 12:01:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F1EDB28022C; Thu, 3 Aug 2023 12:01:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E0DB0280279; Thu, 3 Aug 2023 12:01:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id D27E428022C for ; Thu, 3 Aug 2023 12:01:57 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 967141CA4F4 for ; Thu, 3 Aug 2023 16:01:57 +0000 (UTC) X-FDA: 81083259474.15.2B58736 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf22.hostedemail.com (Postfix) with ESMTP id 0E889C0088 for ; Thu, 3 Aug 2023 16:01:00 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=fXfuTyl9; spf=pass (imf22.hostedemail.com: domain of lkarpins@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=lkarpins@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1691078462; a=rsa-sha256; cv=none; b=srQjKqlqN+J24Htd6fLNlJrX3mSYp55nU/CQk143mC2eFtuWKEmJWpDbU+fs6IFQWHia3H F5l8dI+KUX3eVQD1iAfCevCLqz1ayvQnyCIqucJuWdk3ecw94SBSK0YV3E9/PudGNVqOLJ ciHPvGbiQXM57iZS2y2Di6g/rsw0g6M= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=fXfuTyl9; spf=pass (imf22.hostedemail.com: domain of lkarpins@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=lkarpins@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691078462; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=cwXRj1KBICVmDyXNwF6/K1df3vGE/T6x9GRpnMzQtuM=; b=lHVLDCogLTr1Iu31I4zngvTdDCsv+kMYi1Fk5mZao/tS/1ivciqzH3MU8aakbfM8TEYueR in7awAqVu47BOXOYkQeKmIVbixLPQHsRHWGLs73/a3FrHuuOHZyxFj9rqpyzbpz5OoFtAO GErIaMOGkGKoa9iBZbX1Z91SwuAYrAg= 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-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-212-QB0fpWftNwe4qmNr6gbEdA-1; Thu, 03 Aug 2023 12:00:58 -0400 X-MC-Unique: QB0fpWftNwe4qmNr6gbEdA-1 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-63cf5bb17c6so11700356d6.0 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=Glhm7tTYIqbKeKaYEiI4qJrKde8BVjtw3riAq0kT6cM7MGGXxM6GQbUtSyVt0fbBTd fxcUQJGa8b5fLMmkzD4M29vKSdmI13U4y+/zun4hL+gPay0datSHbfoHumN1/mFQwRZP fgi2NAAQ8S3V2OQpsMcDfz8CGrvfgb4zoin8afWs5TRh4Fcy498LOLW1GuTrpPOup9z7 XTqdOmOwS/+R1lmOEAlRxfZsqXqxGsc8CNbz5CGaPHkQcJnxK3QLdRd5c/B6OAKSmlgf O1aP5H5PKW53CeLXs+FcJZRUVq9yUiGTtq9hmLmxtq7JKIQmIeFmcVrIE9ZaK0OYsfli h+Xw== X-Gm-Message-State: ABy/qLYDbTl8nTXKSLShyYwO/mFs1CiS6PfLVQb2G/JLSoDh2elxMDkI A2lvrDhQvKamqqElL/tXPti1hdxNGM0OVJ7lSw2WJ4LBHrDfMu+i2TLrYlAk1sYNi9SRBEPr1q+ QE/OssTfLVx8= X-Received: by 2002:a0c:cb86:0:b0:63d:b75:c971 with SMTP id p6-20020a0ccb86000000b0063d0b75c971mr19142307qvk.15.1691078457938; Thu, 03 Aug 2023 09:00:57 -0700 (PDT) X-Google-Smtp-Source: APBJJlFCc7WuuoDe+WhLh9WzsibbctR6fIN91ahYBGVYqFqyM7r8CuW7h/Cye78YzhzmJhvadLpnLg== 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 User-Agent: NeoMutt/20230517 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 0E889C0088 X-Stat-Signature: 1hias5xrocdgf3wqui5f8rxofem9trhs X-Rspam-User: X-HE-Tag: 1691078460-410599 X-HE-Meta: U2FsdGVkX1/Z1/sHax5S+Td3xQvj2WTtkJhZs7Z/QD1pWTBIVG+2g01+CfclMhuF+LcX4on2LwPV+heXSnzZQLs2BCvd8ETW2hAxwThWzInH+89mR/v4yrOFTOvFaKFk37B3Q7AKYtbHTreXkMbiqsYPvtjMilbq5OXZvwW4jASJlpPKUp5yl+RgIN1FDDFo1fLjyc94xfKjNf9QsgFyGs5afw20uiMgr0TouDWFOkB4JT9ytApO8fEiq8/GP7M9/LCxUjR01E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D3rcUwgYvbTwfi+NzJ9XhQ3twKsuwcbqZLaX1M3SQ0nZw8YHbjN5y11ruZBrfMkqt+KoU+Iduvd1r9E2QdcZj0Vvd7LLBe35QGej7CQXzt3u3sEjViGWhr+kKzYbgGj93QIBwA= X-Bogosity: Ham, tests=bogofilter, spamicity=0.010321, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 Acked-by: Johannes Weiner --- 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");