From patchwork Thu Aug 3 18:25:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Karpinski X-Patchwork-Id: 13340483 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 22C33C001DB for ; Thu, 3 Aug 2023 18:25:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8FEDD28028E; Thu, 3 Aug 2023 14:25:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8AF2F28022C; Thu, 3 Aug 2023 14:25:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 79DA428028E; Thu, 3 Aug 2023 14:25:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 6AEFA28022C for ; Thu, 3 Aug 2023 14:25:15 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 3C2C1C12C7 for ; Thu, 3 Aug 2023 18:25:15 +0000 (UTC) X-FDA: 81083620590.07.B1BD45B Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf20.hostedemail.com (Postfix) with ESMTP id 1857F1C002D for ; Thu, 3 Aug 2023 18:25:12 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ThP0J0ai; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf20.hostedemail.com: domain of lkarpins@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=lkarpins@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691087113; 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=Bg75TmGjdsFOEFOAfLLtRHbxB/2lhyot0KBO00fo9Xg=; b=cuNEE4wDxChzNUkHOFMpDTQRNAb4vVCOVvwpQwJT4TP6b9hPLkV/teZaUohReqlySaD+JS gg2n6sR9pnDrzPZwKUmPLzmcidTkkrYgh8f9HEIOvrLqls1yLI8LzvnvJI6IpoOTUioWLk etM2pI+jHdE6qfbrDcp40EH/qw9YLqg= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ThP0J0ai; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf20.hostedemail.com: domain of lkarpins@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=lkarpins@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1691087113; a=rsa-sha256; cv=none; b=QfPpU6D7ZhM4YaABfZ/o9pGazH7N4c8ibushLrt8LKyrAdOHzaFl9suX9FBpPAXp/ecFpw IT45LGYrNNhcCjUDnQeWhNyiN5KbuBd2dtEJcV6LE/BLG718pS8UzhZENLM+Eoej/XOSak IyapdjuciwbN5+57MYa/EZaSXAZfRc0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691087112; 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=Bg75TmGjdsFOEFOAfLLtRHbxB/2lhyot0KBO00fo9Xg=; b=ThP0J0aiU3n3zcBF3JH6Os/gpwh4SnKcVlIqbsrJ+i6/zT0Lv93NEwx/MWAh+2jvZV0e+E 1zGp51Rg3opxUIeqjRqnQ7k2inBxbRw+bSiylvuozMcwzdCDFw/+81nPYmbFOwckqm+vnH zLH1OxvmnUyP/TLuhYXXJ3AjLVQGA+M= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-475-M83mBTjjN0m_f0kCOFvIEA-1; Thu, 03 Aug 2023 14:25:11 -0400 X-MC-Unique: M83mBTjjN0m_f0kCOFvIEA-1 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-76cbb1e9420so119708885a.0 for ; Thu, 03 Aug 2023 11:25:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691087110; x=1691691910; 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=Bg75TmGjdsFOEFOAfLLtRHbxB/2lhyot0KBO00fo9Xg=; b=YctRyHlPWaV2Hn8vzHKhGbDZXCc5I+UNG67TzLa0zQHxleBYCnXIqwG2eg+m9E5CrZ 24JlgD7ViTxAgou3J7M/C2d/ooc11ePZiXoPsh3esSxZE/ivRA0NBMit80dqdD07447l VZsmZvyo9ENO7nVzAWO8kPF7iQ5uqjfPA5hJr26jJvDoROZ8cp5iv/7f2XCELWy+LMsx r6NIWMsnWUVXgEG77XzTcruA3y9CjVIVqo9uxtC8KavHZLqmoEqDNufmBz0Be6YHT9B7 veYS5uP23YF6ft+hgVMyF3mCPeZZ+C9sTdbOHVlr88D2/to30VR/KGbatqrJ5cj8tJ1E Y//w== X-Gm-Message-State: ABy/qLaSfGdtbvN+3UZC4rqCHMQ7Neh166PYvWj2gzh72ZBzJDbO6jdy WGgUce7Pe9NrB/beq957tWJvX6tjfdiiKE0o7h9awqI8Q2eQCNHaYiOgxkgx49S1DPnIDH8IP0U X0VFi6pHRu+I= X-Received: by 2002:a05:620a:2411:b0:767:e993:5702 with SMTP id d17-20020a05620a241100b00767e9935702mr19254479qkn.35.1691087110598; Thu, 03 Aug 2023 11:25:10 -0700 (PDT) X-Google-Smtp-Source: APBJJlG8u1dArhCtl/gFW5cvCnwFM7M0fcDbBkzHRi/22XXRQTF7dNuPgLM+jSKKGLekwW/FPx8bXA== X-Received: by 2002:a05:620a:2411:b0:767:e993:5702 with SMTP id d17-20020a05620a241100b00767e9935702mr19254462qkn.35.1691087110340; Thu, 03 Aug 2023 11:25:10 -0700 (PDT) Received: from fedora ([174.89.37.244]) by smtp.gmail.com with ESMTPSA id dq15-20020a05622a520f00b0040c72cae9f9sm105382qtb.93.2023.08.03.11.25.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 11:25:09 -0700 (PDT) Date: Thu, 3 Aug 2023 14:25:00 -0400 From: Lucas Karpinski To: Andrew Morton , 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 v3] 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-Queue-Id: 1857F1C002D X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: yf4gj1r1c8mrtb61adpwaff16zz5q9aa X-HE-Tag: 1691087112-814488 X-HE-Meta: U2FsdGVkX19aRnQzdfcN4aUtYzirSxn6AgjZ8j2kFaaobn6Z+SBqT2mnEW59OGo47s9m787bD1Lzpe5WCDvTUmEwMj+6aoaLqfyjNqqMfAPuQM983G+3FiDO6w6QMBkFbrD/yAqvuKI2ZAQ184g8BSMzsT6NlagtlOY4qTnG5CAgRjq5M60/aPkGMm15jwpO6ReJ8mH2oxoelCCjG3yAv1JPGSSdQjh52SqBBzZgkJwcZH37W74H1M3ag8/j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Ul3AwSHZ0MmhpeTqkTlvv40FUUnuLR1xQHXTTBnVQklIBEbHnMYcKLgC87jnOLyB1eEQj18aPhZZIUl0CQwz+toCSmrCPPAYTjZeG9RlNhliryvxq/zZQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000530, 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 Reviewed-by: Muchun Song --- v3: rebased on mm-unstable 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 1b2cec9d18a4..67cc0182058d 100644 --- a/tools/testing/selftests/cgroup/test_kmem.c +++ b/tools/testing/selftests/cgroup/test_kmem.c @@ -75,7 +75,7 @@ static int test_kmem_basic(const char *root) sleep(1); slab1 = cg_read_key_long(cg, "memory.stat", "slab "); - if (slab1 <= 0) + if (slab1 < 0) goto cleanup; current = cg_read_long(cg, "memory.current");