Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp595937iob; Wed, 18 May 2022 08:48:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKCzV0qM131JfDmXf9SNoWss0QwmnBWGs79Oc1+oAxrSZUA5XQ9KpL4Z3BWaxTRkWA86XU X-Received: by 2002:a17:902:d58f:b0:161:9abd:cff1 with SMTP id k15-20020a170902d58f00b001619abdcff1mr205304plh.135.1652888917689; Wed, 18 May 2022 08:48:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652888917; cv=none; d=google.com; s=arc-20160816; b=Va+N4kqZlPFAEaD9gKbASTYij+jDDHOJO/DkPI8us7Zz/SrZvdaMZess0J/BrwqH7Q hi3FUKn6HZedv5weyGNZHHeKvdOxih9eduORPdbpFOA2gzIyYNosNgLxX81vj7bEbW9n ceNsMFsa7fuvYqgJogknTC4lgFrsW/nGgaMMTjdBxo2LIiyllGOrh/L0tPYYutD8CsuP Xwp3REKVLcJ+DD5h2YkWVldFNhcwA/vSSqp2cVdbRFSqYE5M1iHNmwu7/AmKbnWTioTj uaZjY3tM9mJVdeZJFzqWXs6Sdnx0FhWIoRxgsiTOQDSIsvLWR9fMHoMWuE/Uf4lg6kex NC5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=KUNLA0b9x+opMHbbbhr08H0E2VJuSYLLBACnTDB2Dic=; b=0hZ7V3grVzh+1fQ6LQQor+ayKscadlKzPGCbdo1sxxPH8vPVPpdc9V8IcAImcdYBjP H1hsPsLQ12biFLNAF0MHKPTZ71l99J7T2tMS97Tozzuyw0JChooWT8ajSBOrqIyHqade mVFPIwpVj3++jHu0dwYKqVz3F1/+Z0QsgfbCnHnXptHna0m7/NbYN+5uTI5EbsnuC3YM 5GRatARzJWl8k/RGwuMNBnI0lzBlpucGfJU1KYcU+InyYoKAiKtrd8WG6T3mYL+lAdMT ghudZA9rzLjywie5gtwcpMaFkBz4PIAbAjbfGre1zQmbLQySPg0GyPQvRhwbQUCgb7Le 1iJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=UqYoUqb5; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h12-20020a170902f70c00b00154a68405d3si3135382plo.134.2022.05.18.08.48.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 08:48:37 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=UqYoUqb5; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3CA9AD8083; Wed, 18 May 2022 08:41:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239549AbiERPlA (ORCPT + 99 others); Wed, 18 May 2022 11:41:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239494AbiERPkx (ORCPT ); Wed, 18 May 2022 11:40:53 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E80672CE2C; Wed, 18 May 2022 08:40:48 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 5530421B98; Wed, 18 May 2022 15:40:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1652888447; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KUNLA0b9x+opMHbbbhr08H0E2VJuSYLLBACnTDB2Dic=; b=UqYoUqb5nJc9EZ77jyiai+SjiEo9dhFuOX2NLDKRFVWPUDk+UcCDOftCF3sUPcMN80I5TJ ydA8ZJI4nSn9qJjMjijjmjZoeM0OLgVz95mOuhE7ewMGEIRHfWg1IKVNzOXdUGeQX9xpMm hD6Vh0aq5kSs2cIpoS2dTSF0kn8/eaU= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2844A13ADC; Wed, 18 May 2022 15:40:47 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id sBz4CH8ThWJDUgAAMHmgww (envelope-from ); Wed, 18 May 2022 15:40:47 +0000 From: =?UTF-8?q?Michal=20Koutn=C3=BD?= To: cgroups@vger.kernel.org, linux-mm@kvack.org Cc: Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Richard Palethorpe Subject: [PATCH 1/4] selftests: memcg: Fix compilation Date: Wed, 18 May 2022 17:40:34 +0200 Message-Id: <20220518154037.18819-2-mkoutny@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220518154037.18819-1-mkoutny@suse.com> References: <20220518154037.18819-1-mkoutny@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 This fixes mis-applied changes from commit 72b1e03aa725 ("cgroup: account for memory_localevents in test_memcg_oom_group_leaf_events()"). Signed-off-by: Michal Koutný --- .../selftests/cgroup/test_memcontrol.c | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/tools/testing/selftests/cgroup/test_memcontrol.c b/tools/testing/selftests/cgroup/test_memcontrol.c index 6ab94317c87b..4958b42201a9 100644 --- a/tools/testing/selftests/cgroup/test_memcontrol.c +++ b/tools/testing/selftests/cgroup/test_memcontrol.c @@ -1241,7 +1241,16 @@ 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) + parent_oom_events = cg_read_key_long( + parent, "memory.events", "oom_kill "); + /* + * If memory_localevents is not enabled (the default), the parent should + * count OOM events in its children groups. Otherwise, it should not + * have observed any events. + */ + if (has_localevents && parent_oom_events != 0) + goto cleanup; + else if (!has_localevents && parent_oom_events <= 0) goto cleanup; ret = KSFT_PASS; @@ -1349,20 +1358,14 @@ static int test_memcg_oom_group_score_events(const char *root) if (!cg_run(memcg, alloc_anon, (void *)MB(100))) goto cleanup; - parent_oom_events = cg_read_key_long( - parent, "memory.events", "oom_kill "); - /* - * If memory_localevents is not enabled (the default), the parent should - * count OOM events in its children groups. Otherwise, it should not - * have observed any events. - */ - if ((has_localevents && parent_oom_events == 0) || - parent_oom_events > 0) - ret = KSFT_PASS; + if (cg_read_key_long(memcg, "memory.events", "oom_kill ") != 3) + FAIL(cleanup); if (kill(safe_pid, SIGKILL)) goto cleanup; + ret = KSFT_PASS; + cleanup: if (memcg) cg_destroy(memcg); -- 2.35.3