Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp273789rwb; Fri, 4 Aug 2023 12:28:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGJaAL/5Nj00kOPWGvAYsdZvrqtSIb5jjB9JVrNNGErb9gXgzHd/GOUam5ISHktabRL2nmw X-Received: by 2002:a05:6a20:3d0e:b0:123:4ffe:4018 with SMTP id y14-20020a056a203d0e00b001234ffe4018mr3729369pzi.60.1691177314810; Fri, 04 Aug 2023 12:28:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691177314; cv=none; d=google.com; s=arc-20160816; b=qVI6AR6cyMFbE/SbLMIjNG8oYQLaE0HA4k0KIlKnxreqmow7699Smyl+6tD8i8bCYK w2dP+Cd0O1Z+jRRe0/AKhIACU+VmhucsfExbzEFrhBEoNC+A87C7weMmDGpofZpcPfkJ ZhtSeyGwVsZJ2MtbK74N5yRe4+N3zdGchGUBPNc2Nh445NRf9xTMYGsFxHNVmgWciLLD /ZRd7LDfBiEU+XsDI9BBMzXBLbTVmuODth1W+3s72inrvQ6q1VTSqFIaMG03WGT5C1oi sHwaVng8tzfTvSI673SQX4jOpPXaDqD7XlCzsTmC+lDuA43GGZRe3cS27qPo7Simww17 YHBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=8TRlrLFCMco4XO+xD44hANqOAJKBhYI/ogDyetWODDc=; fh=/ean6TD/FpSHVQxkA3eUx7ghT4tlSJ04FQJpZeoqMjY=; b=fxl4jUUzjoLTq526pUm/5A4BJ29VVIoq2T4UNjfdRp4SEgtByNTqXkjV4Pi98cuPz8 Vb4jpYOx0moLnZWRLnYI1YzpAL4JTkEs5GiKMFi36+HN8RJPh4MBaKqFsfa5+z46b2Dc lmaZjDLapYVXZS9q9Pwt7nCBuM/R8WvgDTdtNiVF48GdM/2dN7IUrxRmQPwKsK1/WLdu xofBV4/G3Uxx3AnjbPrnxcRYQat6g6BVz0GhIu1C4WJkQ2MB2ewjM96N4HbThN+Dvwjl LjT+J4WhY3EaH4nZzQ0zHTNuqUgeBl5tCgtqqPPJI+W7zfvvQf6QIEzFlZ5PhKcU3Dww yhgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DkvzRZsw; 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 j11-20020a63230b000000b005347c4d09ddsi2071964pgj.678.2023.08.04.12.28.21; Fri, 04 Aug 2023 12:28: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=DkvzRZsw; 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 S229989AbjHDTAc (ORCPT + 99 others); Fri, 4 Aug 2023 15:00:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229863AbjHDTA0 (ORCPT ); Fri, 4 Aug 2023 15:00:26 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7256749F3 for ; Fri, 4 Aug 2023 11:59:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691175582; 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: in-reply-to:in-reply-to:references:references; bh=8TRlrLFCMco4XO+xD44hANqOAJKBhYI/ogDyetWODDc=; b=DkvzRZsw6AnsiH0hnBoIaVgjbubMegcslV/GzKI/nS1/+WQ3Nb+5nSACkOhQ3PUEOzV+vb UJF094doG/8mjk2AH7HAnyaYODadgRJXJnHi0E1tUEkPvRQmRzVgzsohm/Blc9w3q/zBYi nv6SODTQGM7fRUsMPA/tyGKJ+omCs8c= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-295-mU3rZPnZMhiHXMXmnoqXjQ-1; Fri, 04 Aug 2023 14:59:40 -0400 X-MC-Unique: mU3rZPnZMhiHXMXmnoqXjQ-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-63d0c38e986so22142026d6.1 for ; Fri, 04 Aug 2023 11:59:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691175580; x=1691780380; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8TRlrLFCMco4XO+xD44hANqOAJKBhYI/ogDyetWODDc=; b=OIDD+CkihHVg4mC0sDAW0UrJzaC6GK5ZOWlmHqtb55TxHkX/hDbGpyNxMkKB8pR9le TlaFRdkfJcTlBUZMaiq7N56zyCKLoUyfNC2Ft6xP8yjQuhIGtu0j7SmZCKgL5C6OvMKs wdT+XYcYRAlN+5qj1nYkVlPJZagIu4FwbbxvYYdT1VcnpdYiYFqk5gWg6EaEgHvO8/Zv Tr4+dlazaIkAQ5VIzITEVouiYEpK/ai39UDoXNUkccjRygq/UMDbwwZ1ud7SVWu8ezzb iK8ucF9uZNTKAlDwI8lN6w+I+neLvkshUQpxR2JNldDJUVbAr8vtdOoWWSYkYJ2tGkRd yv4Q== X-Gm-Message-State: AOJu0YzHBKbIRB1pZXRdeX9vOl716HfRiHXbFflcdnjNj7aKPx+CCaRD lAfDCRJ7IcdCdoai+jLzSyHrnuK8xCoYxQMaR4LTEzWWbef2nibeHEnO0YmEG5O/nTwtydKhHyc DKzcjO8j2Y55l/o8jZJDF/qzx X-Received: by 2002:a0c:eb02:0:b0:63c:d901:d5d5 with SMTP id j2-20020a0ceb02000000b0063cd901d5d5mr2546180qvp.34.1691175579970; Fri, 04 Aug 2023 11:59:39 -0700 (PDT) X-Received: by 2002:a0c:eb02:0:b0:63c:d901:d5d5 with SMTP id j2-20020a0ceb02000000b0063cd901d5d5mr2546163qvp.34.1691175579724; Fri, 04 Aug 2023 11:59:39 -0700 (PDT) Received: from fedora ([174.89.37.244]) by smtp.gmail.com with ESMTPSA id y14-20020a0ce04e000000b0063f7a2847bcsm32703qvk.51.2023.08.04.11.59.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Aug 2023 11:59:38 -0700 (PDT) Date: Fri, 4 Aug 2023 14:59:28 -0400 From: Lucas Karpinski To: Johannes Weiner Cc: Andrew Morton , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Tejun Heo , Zefan Li , Shuah Khan , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] selftests: cgroup: fix test_kmem_memcg_deletion false positives Message-ID: References: <20230804163716.GA337691@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230804163716.GA337691@cmpxchg.org> 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 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 On Fri, Aug 04, 2023 at 12:37:16PM -0400, Johannes Weiner wrote: > On Fri, Aug 04, 2023 at 11:37:33AM -0400, Lucas Karpinski wrote: > > The test allocates dcache inside a cgroup, then destroys the cgroups and > > then checks the sanity of numbers on the parent level. The reason it > > fails is because dentries are freed with an RCU delay - a debugging > > sleep shows that usage drops as expected shortly after. > > > > Insert a 1s sleep after completing the cgroup creation/deletions. This > > should be good enough, assuming that machines running those tests are > > otherwise not very busy. This commit is directly inspired by Johannes > > over at the link below. > > > > Link: https://lore.kernel.org/all/20230801135632.1768830-1-hannes@cmpxchg.org/ > > > > Signed-off-by: Lucas Karpinski > > Maybe I'm missing something, but there isn't a limit set anywhere that > would cause the dentries to be reclaimed and freed, no? When the > subgroups are deleted, the objects are just moved to the parent. The > counters inside the parent (which are hierarchical) shouldn't change. > > So this seems to be a different scenario than test_kmem_basic. If the > test is failing for you, I can't quite see why. > You're right, the parent inherited the counters and it should behave the same whether I'm directly removing the child or if I was moving it under another cgroup. I do see the behaviour you described on my x86_64 setup, but the wrong behaviour on my aarch64 dev. platform. I'll take a closer look, but just wanted to leave an example here of what I see. Example of slab size pre/post sleep: slab_pre = 18164688, slab_post = 3360000 Thanks, Lucas