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: 130134 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f41:0:b0:3e4:2afc:c1 with SMTP id v1csp719248vqx; Wed, 2 Aug 2023 13:53:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlFpy+GYFohdvSH8NxH0K+X4Q9IK4bhgD8hTBKq8A8zZcflPfbp8bqMG0a8SjLjRDhTcWiaF X-Received: by 2002:a17:902:d511:b0:1b8:b3f9:58e5 with SMTP id b17-20020a170902d51100b001b8b3f958e5mr18070158plg.38.1691009614086; Wed, 02 Aug 2023 13:53:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691009614; cv=none; d=google.com; s=arc-20160816; b=pQPrpTWuy75wrogOMHkqnAWptVdRENlZP5raoOIj7KoXL3jq/PColtqP3xMYPxnL2u ld+WKYhjrclpZzcNRelYgoYTRk4AUS5GQ1TTGrI3Q6iyKtSlvL2wUTEukwQoDCZoEf5m +ELoH0AiqTzo40emqFvX7H9uPbXB2IfV94n2xM63dKwhFOISZzkvXp72kRDRjLFhfkZy lKjvLnLcL/320Y+P2WE6ID2gj7d53D4dUx9xOcifKk/Hsbbg7GnjTX9tk5bKOhDQIbEj MJs1ziltvuabny9wIQI1kKdchST35PZ7P/SwQ1mQAKo30N2MTjx7E1npG/fJAdvFBe6F yE5A== 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=1UYMawsk0oCgqDs8Xb3YIEArI5yAvmzUq9f9k4hm6BI=; fh=OBxDCp0+I+8sKHZotCmrxLU4VCRgU6g/M9KuxKBXuW8=; b=FcfhA3/uDp5yPSJmaHGcmJYnMudttkwV7UywzpqAHnfss/nvNI4xty0RoGPuvDq4F2 r2ZpbeMsdkYYI6Shv58BhuxMY3g0QO0GAcnEHYQTG88VnMqb/pmmYVqUJ5xRM4LfFIbq qJhu01VgSaUXlqCShvx/jGtV3c/Jqg9kewdNRsu1guEf+HafK9XC3raj+jCG0vjmrKBr UH7xGduhXQIBlV5RCh3ZiGnnsd68oKkZOjDfIkUa0V0rf5vwVZcp+cWD2Dil72T0XYzY QqnjllnmF9rF8yNbHE9LUJsbwZoa6+SUH3ZlkUfEZMiqUNUs4urYItcOMkOUcN/rBALW pWWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="W9nA/g8A"; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u8-20020a170902e5c800b001bba3670a8fsi11750694plf.450.2023.08.02.13.53.20; Wed, 02 Aug 2023 13:53:34 -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="W9nA/g8A"; 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 S229799AbjHBSmI (ORCPT + 99 others); Wed, 2 Aug 2023 14:42:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229697AbjHBSmG (ORCPT ); Wed, 2 Aug 2023 14:42:06 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E8D61BF9 for ; Wed, 2 Aug 2023 11:41:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691001677; 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=W9nA/g8AbvhKkRyD8y5SWla6yhuSnSEKfURHKnpY5nnGG3k6i8gTkSITTsvrj7B/IuDUFY LyIjkOdl7IPNEF8bcEfcpk8q+oqvDXlf7OnbWjFDr+JNJW25F5rdyPqj2IwU/56kgZBS46 Jn7YIldr7ekwXnKJv9JVF9W8SXqBXfM= 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-682-S9YRtVu0OROtCI9tiqQAKQ-1; Wed, 02 Aug 2023 14:41:16 -0400 X-MC-Unique: S9YRtVu0OROtCI9tiqQAKQ-1 Received: by mail-oo1-f70.google.com with SMTP id 006d021491bc7-56ca7604435so53801eaf.3 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=QQiwFt3dTQTygFxXprDB2j44UAl1aSZMJafZj0VrGBPS/w9lMLc+ZgksOadWHNo1ez TNZM6ibpXPslaL1g9it6NL7bIHfk42FgWtgkG7KcHiX/MLpMozQoT6SktKjd5kjJRnV+ ezLvBn+rcPegZy33Iiou0CuSZ8pf3tAzuOYAU+j1MT/1dRdyuAOaspfBYWarNFtgb8zh 1w5s2q0k+g4POg5AOfHtUg4pm7ina3KjZGXuDir+KFNE09JevAKnbXsu6XFbN8LdB6LD m8mjbHJ5SNJLjaYCejcbJYy3hG/6466e9m5W9S2fiAopMLCvqfVDMQPcpyluyho6UYWH 20IQ== X-Gm-Message-State: ABy/qLbV7Z8FJ6pW0S9KUqyR6w6pstBOwKd5gOacx5FNbbDcLKlJ0gYT fpUdIHKdc7LBzNr1EFMZARDi0Yl9s/5lYfbIhAbuLEOOGW+T2qmae2VhJI7vRTG9V+yDORWOy7A C8UYfPlqgu/02zSUWl7/B1bQ1 X-Received: by 2002:a05:6358:5918:b0:130:e0a9:a7b4 with SMTP id g24-20020a056358591800b00130e0a9a7b4mr7076768rwf.13.1691001675289; Wed, 02 Aug 2023 11:41:15 -0700 (PDT) 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 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_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773152097355934288 X-GMAIL-MSGID: 1773152097355934288 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");