Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2689102lqo; Tue, 14 May 2024 06:35:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUHGoJGbyXyB1Uj93P6pLwQl2Y2jwR+jiNKr947mkxkR0dBTT49v+yLXtx5OwMnDl+Rc7eVQ7oACR6uHY4fbIwFCbZqLCNWq/yIaZZ8fw== X-Google-Smtp-Source: AGHT+IEie31dUp4+CrTozZBdez6QD5gXudBEVs4vFl31PKXm06fohNjJvA9xr/+g076B3dj6oSa4 X-Received: by 2002:a17:90b:98:b0:2ab:8e59:9da9 with SMTP id 98e67ed59e1d1-2b6c6ff020cmr19075534a91.6.1715693744835; Tue, 14 May 2024 06:35:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715693744; cv=pass; d=google.com; s=arc-20160816; b=bNlYiJrUWv6F/xOHyy3XZcUZui//mf4mR6VsEZeWlpAmITHgMMz6Hk6KWQ+RemWEmy 8u3eUzBknOgRBMime0AD/t7xlhrYzMksBt+mIARAyMIhtwFNFbAbuhKxuNxboS2GRgg9 bIdDfXwmKtbfHjyS0cmTU/zgAxOPxT+SgO8yiECnoQ7EtGvpnZhVAQSP7EXOfehzSmRa 3F5z/LLHQjymTyP8S0dKw0DokSrEcKf8NQZds784QEu7bQhiZ0K0G74+fc/6KgZpOobi EuakY3AoM5wBWOnrM4TtHXK8YMf+GyusOfoMA6luJSLFxcuX2sAg6Nbl7v6ryhuP57TJ uQ9A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=Q8V3hdpwL1wGvuEOSlpLcRgdkBEzexJVsO59ECPAhPA=; fh=wmY4RLakUtHe8I5/hgPnrF2w+rym1ywlLWvkZ/HI6KU=; b=PUN53e1gh3B9lQkIZoPjBqrmdbz4uQLGmUlvlU51Whmm4GH2iBPw5FRU8PQsxkONak AeKelHi8JCk4cNerj+bG7dpWX7xbtqsCkQOXPy9QNxf7Ww2eOqbgbXLbzEAcZKGseiLZ 9numhLzSjB6gtZx1wfL0AFUIW6KPxDft8qUDTd0LAdiIoXBhGxsT7t5qWc3UOIhR5Hmo uIIUiNaU/8wRbXBUhgHmHhzogULs75f0sW8t8hDzrD0EfcXUhCOzxQIBCAdnccWNJLUj +QYzAjzKTD+8qMENkUXULjn4aisjFMpeFd5vlH+JXlj0Hh3BCq8EdOalDfDLV/EZkbdn 28ow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-178744-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178744-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b670f4cbe6si11147584a91.43.2024.05.14.06.35.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 06:35:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178744-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-178744-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178744-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 7D07CB22144 for ; Tue, 14 May 2024 13:28:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7D26E15A49F; Tue, 14 May 2024 13:18:15 +0000 (UTC) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 12A3D16F914; Tue, 14 May 2024 13:18:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715692695; cv=none; b=rHXTAG1coYNslmTtAirp84wtLJU9j5juHX6DUBQCotcY93dgQDh/m6dP+hlKBVcTu6KAcRlqpg7eFhexkPEnG5huQ2IzSaQ1qVHVMxCvpuYpG7ZzleA/AgnTtOPV9FJIpBdi5/Bt7JTk4rlgGQYSbg3tHOznKPbOlKMuNP/dJa4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715692695; c=relaxed/simple; bh=u3zZKvp/Li0Baa2NbytJvsymp3HNHzVCO1pa5Z3LiJ8=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=a6EtiINK2tVrAG4WVybavPGeEB1qWHEbAk1p2jrEl9Jf5arA1fi4fImUU9mS5/X6atX9F4uJhrAndR7Keq7GvZsMChzZKm0aJNG454UxfatdahKZgzq3yLz+KkZBbxbWLzeUPMk2LLxF7Tr2MaFC/JGQ+NKV8hvKQr04rq3QiXY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Vdxf438tkzkXWs; Tue, 14 May 2024 21:14:36 +0800 (CST) Received: from dggpeml500023.china.huawei.com (unknown [7.185.36.114]) by mail.maildlp.com (Postfix) with ESMTPS id 41EAB18007E; Tue, 14 May 2024 21:18:09 +0800 (CST) Received: from hulk-vt.huawei.com (10.67.174.26) by dggpeml500023.china.huawei.com (7.185.36.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 14 May 2024 21:18:09 +0800 From: Xiu Jianfeng To: , , , , , CC: , , Subject: [PATCH -next] memcg: don't handle event_list for v2 when offlining Date: Tue, 14 May 2024 13:11:06 +0000 Message-ID: <20240514131106.1326323-1-xiujianfeng@huawei.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpeml500023.china.huawei.com (7.185.36.114) The event_list for memcg is only valid for v1 and not used for v2, so it's unnessesary to handle event_list for v2. Signed-off-by: Xiu Jianfeng --- mm/memcontrol.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index d127c9c5fabf..4254f9cd05f4 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -5881,12 +5881,14 @@ static void mem_cgroup_css_offline(struct cgroup_subsys_state *css) * Notify userspace about cgroup removing only after rmdir of cgroup * directory to avoid race between userspace and kernelspace. */ - spin_lock_irq(&memcg->event_list_lock); - list_for_each_entry_safe(event, tmp, &memcg->event_list, list) { - list_del_init(&event->list); - schedule_work(&event->remove); + if (!cgroup_subsys_on_dfl(memory_cgrp_subsys)) { + spin_lock_irq(&memcg->event_list_lock); + list_for_each_entry_safe(event, tmp, &memcg->event_list, list) { + list_del_init(&event->list); + schedule_work(&event->remove); + } + spin_unlock_irq(&memcg->event_list_lock); } - spin_unlock_irq(&memcg->event_list_lock); page_counter_set_min(&memcg->memory, 0); page_counter_set_low(&memcg->memory, 0); -- 2.34.1