Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1345896rwo; Wed, 2 Aug 2023 12:29:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlFkLqoD6DbsXVryc9i2VukTufLeUdZFM/9XVI+au1QOZhOT3iCm0zZ8Fo1zAihRtpJ1DlDK X-Received: by 2002:a05:6a20:1596:b0:13d:d5bd:7593 with SMTP id h22-20020a056a20159600b0013dd5bd7593mr9875776pzj.12.1691004545992; Wed, 02 Aug 2023 12:29:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691004545; cv=none; d=google.com; s=arc-20160816; b=P3wEG2L49WyhDFt4DHeM8K3ia9sg1cwA/eXAuL6CwwFFkTGas4BZAIn2+gYiQ6mE8L t1tOaABsuQM3fXF8CqZ2c2MzP1yl0J7C3zNf1azroiurBEsQh4Z2ScLYyMVAU91PAHqp RyYd5I+IEzhq3fcaERoYgKl4HJDVjaLHbpcj9UyOGptTHEAYkH3xA4UYoKm5ATfdeidR a/bLbZcnp7Fzf+mCOlksTFL+Gl+KijvarTa2lUwTks2L7f2u5oJSawvmrj+7cyPBgSsU dpDMaX7eVb2Uo2MJDzI6EpvmsGnNJk3N/R5pJc4VSbHk99tLjb74eIposYkZcI/VRvZR tAeQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x185-20020a6386c2000000b005573ea250f0si7862015pgd.116.2023.08.02.12.28.52; Wed, 02 Aug 2023 12:29:05 -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 S229693AbjHBSmI (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-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_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 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"); -- 2.41.0