From mboxrd@z Thu Jan 1 00:00:00 1970 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 33425C433EF for ; Fri, 15 Apr 2022 14:08:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A10566B0071; Fri, 15 Apr 2022 10:08:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 998616B0073; Fri, 15 Apr 2022 10:08:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 812BA6B0074; Fri, 15 Apr 2022 10:08:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id 6BF406B0071 for ; Fri, 15 Apr 2022 10:08:22 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 15C8CA92 for ; Fri, 15 Apr 2022 14:08:22 +0000 (UTC) X-FDA: 79359293244.07.4CE7899 Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) by imf17.hostedemail.com (Postfix) with ESMTP id 602E54000B for ; Fri, 15 Apr 2022 14:08:21 +0000 (UTC) Received: by mail-qk1-f180.google.com with SMTP id j6so6694588qkp.9 for ; Fri, 15 Apr 2022 07:08:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=uHT+rtsiU2AlOqKjuhO/N6AsKRtwVlo+UNwK//XAC5E=; b=ffFY+UKJVR4NozHik4y+MyaAwJdzaYX5eT+NwNGh36b/cPlG1wai4K0OIY8X4LB8F4 Wmc36VT21fXn0B1S5vxx2QaX2oLbGAo25gULbNJocjXEhtvQ7wFUuJSjGI9mAN2/asXM 4MHt2awW9+WsJePBtBSd4WT5eVe4MopH5rQmFLCynq4jn6dpgzpfFrEY2qInOh2YffqE hOPVTE0E/7RCLi+n289pDc4kjjJZ4Tk6FHfft5Q4qlMhszC2xtPar+ouuuApaWX20CrP sGkq/mL8Wc45nykie2Ch+jFuiALNCRg1njrY210Fp4CM5Ek+l0goc5i5IeOorN6oH/dK DXhQ== X-Gm-Message-State: AOAM532t3OLMjM1TYDmHov0NCOkyguZo5CHd4JPUNMFE2L4WqxXvuICE yIJUICIEbIUJZhzqf5hJrvE= X-Google-Smtp-Source: ABdhPJyQuMIVfA3EofR+pKzVdgIzoZLxbA/QPzQX7WZh1MG4ZvuwD4FbA60REwVdu7d5mrVWF/z69g== X-Received: by 2002:a05:620a:2946:b0:699:c582:f319 with SMTP id n6-20020a05620a294600b00699c582f319mr5622724qkp.118.1650031700522; Fri, 15 Apr 2022 07:08:20 -0700 (PDT) Received: from dev0025.ash9.facebook.com (fwdproxy-ash-117.fbsv.net. [2a03:2880:20ff:75::face:b00c]) by smtp.gmail.com with ESMTPSA id i136-20020a379f8e000000b0069c7f8b69b8sm1947719qke.82.2022.04.15.07.08.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 07:08:20 -0700 (PDT) Date: Fri, 15 Apr 2022 07:08:17 -0700 From: David Vernet To: Roman Gushchin Cc: Andrew Morton , Tejun Heo , linux-kernel@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org, Johannes Weiner , Michal Hocko , Shakeel Butt , Chris Down Subject: Re: [PATCH 1/4] kselftests: memcg: update the oom group leaf events test Message-ID: <20220415140817.ljznpvacne6nchg5@dev0025.ash9.facebook.com> References: <20220415000133.3955987-1-roman.gushchin@linux.dev> <20220415000133.3955987-2-roman.gushchin@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220415000133.3955987-2-roman.gushchin@linux.dev> User-Agent: NeoMutt/20211029 X-Rspam-User: X-Rspamd-Queue-Id: 602E54000B X-Stat-Signature: jwwcrxcxs97q7osia5z8kki7w6q9bmjs Authentication-Results: imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of dcvernet@gmail.com designates 209.85.222.180 as permitted sender) smtp.mailfrom=dcvernet@gmail.com; dmarc=none X-Rspamd-Server: rspam01 X-HE-Tag: 1650031701-46362 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Apr 14, 2022 at 05:01:30PM -0700, Roman Gushchin wrote: > Commit 9852ae3fe529 ("mm, memcg: consider subtrees in memory.events") made > memory.events recursive: all events are propagated upwards by the > tree. It was a change in semantics. In one of our offline discussions you mentioned that we may want to consider having the test take mount options into account. If we decide to go that route we should probably have this testcase take memory_localevents into account as well. If so, I'm happy to take care of that in a follow-on patch after this is merged as I already have a patch locally that reads and parses /proc/mounts to detect these mount options. > > It broke the oom group leaf events test: it assumes that after > an OOM the oom_kill counter is zero on parent's level. > > Let's adjust the test: it should have similar expectations > for the child and parent levels. > > The test passes after this fix. > > Signed-off-by: Roman Gushchin > Cc: Chris Down > Cc: Johannes Weiner > --- > tools/testing/selftests/cgroup/test_memcontrol.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/cgroup/test_memcontrol.c b/tools/testing/selftests/cgroup/test_memcontrol.c > index 36ccf2322e21..00b430e7f2a2 100644 > --- a/tools/testing/selftests/cgroup/test_memcontrol.c > +++ b/tools/testing/selftests/cgroup/test_memcontrol.c > @@ -1079,7 +1079,8 @@ static int test_memcg_sock(const char *root) > /* > * This test disables swapping and tries to allocate anonymous memory > * up to OOM with memory.group.oom set. Then it checks that all > - * processes in the leaf (but not the parent) were killed. > + * processes in the leaf were killed. It also checks that oom_events > + * were propagated to the parent level. > */ > static int test_memcg_oom_group_leaf_events(const char *root) > { > @@ -1122,7 +1123,7 @@ static int test_memcg_oom_group_leaf_events(const char *root) > if (cg_read_key_long(child, "memory.events", "oom_kill ") <= 0) > goto cleanup; > > - if (cg_read_key_long(parent, "memory.events", "oom_kill ") != 0) > + if (cg_read_key_long(parent, "memory.events", "oom_kill ") <= 0) > goto cleanup; > > ret = KSFT_PASS; > -- > 2.35.1 > Looks good, thanks. Reviewed-by: David Vernet