From patchwork Wed Aug 2 18:41:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Karpinski X-Patchwork-Id: 13338735 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 4F8B4C001E0 for ; Wed, 2 Aug 2023 18:41:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B3CAB2801D7; Wed, 2 Aug 2023 14:41:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AEC072801AA; Wed, 2 Aug 2023 14:41:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 966D12801D7; Wed, 2 Aug 2023 14:41:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 853702801AA for ; Wed, 2 Aug 2023 14:41:23 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 3EF554093E for ; Wed, 2 Aug 2023 18:41:23 +0000 (UTC) X-FDA: 81080032446.13.449BD07 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf10.hostedemail.com (Postfix) with ESMTP id 02B49C0006 for ; Wed, 2 Aug 2023 18:41:19 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=hlU692nJ; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf10.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=1691001680; 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=1UYMawsk0oCgqDs8Xb3YIEArI5yAvmzUq9f9k4hm6BI=; b=hcGeqeEv2XlkYCv+beBkcCd+vlCEk57kqJsMn4RiBqHO095JhONbbC/7Bz3Ay/z8KkXhQ5 XyZXGs81D9+FVJnQ4fNLzGqmTe+QeWQ73qY1B7RTJJr+eh9cv1uJFqVF4iMJYaxnahu8Z+ 3ruLA6r5OMuYTbH3AyU3aMlmQC2qJt4= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=hlU692nJ; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf10.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=1691001680; a=rsa-sha256; cv=none; b=oQ5HObTtuvVnrRy2vnrrMki6J23GnJaZdF87VZyJHKjMljbp/lz9YcW9PUlPsJajvtDAUD v5M6/vGtUPZxn+4zZ/Kn/obDHNaE07Fkw2/kjKNRvG04P79Gat17tX9mv34sbD9wBjjfy3 0uJOVkdcytO03t4pdsKDn2o3eoWJ6Bo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691001678; 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=1UYMawsk0oCgqDs8Xb3YIEArI5yAvmzUq9f9k4hm6BI=; b=hlU692nJSS1YmrQvqrcNEI3F/4rODTP5R/nfvJKU4SoziZMiK4KCNyWInkAv7jR0tANUiF QJgmI9L2JgN2mcUzV1KyY8gCeg0eeiqRIbWZEqHj63CW5hKNSSefbg1FvSLmqidy5BpXS/ 9IV6OxAteB+9L7HFAOxw+vpjZY7+lHc= Received: from mail-oo1-f70.google.com (mail-oo1-f70.google.com [209.85.161.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-473-zghLHp5uOPSdeOZL5ovnzQ-1; Wed, 02 Aug 2023 14:41:16 -0400 X-MC-Unique: zghLHp5uOPSdeOZL5ovnzQ-1 Received: by mail-oo1-f70.google.com with SMTP id 006d021491bc7-56c85f719efso85981eaf.0 for ; Wed, 02 Aug 2023 11:41:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691001675; x=1691606475; 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=1UYMawsk0oCgqDs8Xb3YIEArI5yAvmzUq9f9k4hm6BI=; b=fQ5Av7GaiYx5RX4/btFyDApsuHJxMf55r9LZ62rGnWrTM4G5r3Xdl/xkVBvrYBbgeu jC6fyv0p2Vi8YudR32Bqa9c3RrH022l1S4AP2zRrtqflDReFyoin2UhZHTaeJYiRPFtl dDREa0cSqqNN1FUSHia7cJGAcftaCmbw5f/ceHbmNOljLUNnB/y3A3sjN29FWfswdR+p gah1ga6maiyayK38MiMXg7eKF6YZ+KobEvEYSyZKT17i2JdoVWWE/7cFczGejTnBv93x 2fjmVwuUfCwZAOqx9jbJa6r6967d971xbDEtxl8/1qU+qvAY+wL9cPAwH5x+2nJLBUZ+ WOvA== X-Gm-Message-State: ABy/qLb+PeeT5172TtmPCbBO2qzbR3zO9gMoXJOL5bwz2Y/Mht7IdZIE tH1IjtCDSrnJn/f4je0PeWfiyjP6tFRVCe9QWtBjh+Vj/JYrEWuqWqrUgyjzj/oto5ODku/4TlK DI6Nf4OSSfOc= X-Received: by 2002:a05:6358:5918:b0:130:e0a9:a7b4 with SMTP id g24-20020a056358591800b00130e0a9a7b4mr7076777rwf.13.1691001675299; Wed, 02 Aug 2023 11:41:15 -0700 (PDT) X-Google-Smtp-Source: APBJJlF1osoJlfc9v59xe7LwsMDO2S8I2onE4ro0S+jGWhtYYkSU3sePcQ+wmFSxNttOEIGLNBil8w== X-Received: by 2002:a05:6358:5918:b0:130:e0a9:a7b4 with SMTP id g24-20020a056358591800b00130e0a9a7b4mr7076758rwf.13.1691001674997; Wed, 02 Aug 2023 11:41:14 -0700 (PDT) Received: from fedora ([174.89.37.244]) by smtp.gmail.com with ESMTPSA id d28-20020a0caa1c000000b006363f2c37f0sm5742380qvb.91.2023.08.02.11.41.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Aug 2023 11:41:14 -0700 (PDT) Date: Wed, 2 Aug 2023 14:41:05 -0400 From: Lucas Karpinski To: hannes@cmpxchg.org, mhocko@kernel.org, roman.gushchin@linux.dev, shakeelb@google.com, muchun.song@linux.dev, tj@kernel.org, lizefan.x@bytedance.com, shuah@kernel.org Cc: muchun.song@linux.dev, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] kselftests: cgroup: fix kmem test 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: 02B49C0006 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: a8pwnz3e8wzqn19bwef6xzhrmm517qgh X-HE-Tag: 1691001679-815419 X-HE-Meta: U2FsdGVkX185lQprKWctltvrAI5GHsuo4GlaztQaQC0durUg/qnhaCfwirsg84YdaLhsPbV0h2tbNbKkv+nMKb/sN6PmZn15qmfOmAqi43u45gQhuw5/HCEXO4df1mFw8JG5hmsKvCDsFg7lRjhgQc/Tr3C0i9yZU0qIwROrc8RUGlWYjGvLql6I0N3xb/KFnbkUBnb/dpLxkmYGNFmzbYn5J0mVVSl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uyn7Xr511hlW/YPTnpWdN4I20osrBy5G4SbT9c9SiJLHC1KPSLiJkkWi+SEPJHyMeaQxP1cD1I X-Bogosity: Ham, tests=bogofilter, spamicity=0.128032, 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 --- 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");