Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2760124lqo; Tue, 14 May 2024 08:21:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXcOEeg+rkBf6l+hWbwl2ITjsuWV3U7SZh+3DmP3Gg6MHASuGXDLbZCQY2weFUa2mtP6lV6HBK0/gR6/4ENVtsGFmR5Fydf9q1Klm5IcA== X-Google-Smtp-Source: AGHT+IG11+T/VGpA5Wozjgzw1hezHeAq85oxV5JvUXvaYi/KR5gK4yQKd41TtXu7kP7LQ/Atb5E2 X-Received: by 2002:a05:6214:4893:b0:6a0:d04a:d2de with SMTP id 6a1803df08f44-6a168230369mr146968926d6.42.1715700105661; Tue, 14 May 2024 08:21:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715700105; cv=pass; d=google.com; s=arc-20160816; b=ZEwPLToRxdlpmPdeXMoStDw4QsWiP6SWQM+77vC5yPQJRh7HcOfIu2VpRCvuxKWJNy ibpZrehqhUWc7wNjYNVTpfFt0ympO50Il9dWmv7q7c+0Jv5J7dab0hpbkfH71KyRVHxc RXzSPx+UdKGh+Z2WF1ZWpVDJLyPSDPhRp2LJ9VsB1iLzOdRyOUBrgvg61ximgEMm+5rC 2y5mU/q1d4eF0UWEtWWu6QWpi0b4mRz4TRgj+80g6/H1j0eGb4UP8uMDwclHjJvEewtC Fs4qYvvoj8koBqoG0+IK0HH6FLIh1+qFq5oQ2Wzyu6gSxnXBmyvxVuGtpHL1ByMwLgty 34DQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=Zp/ZA/wPWSCpzR8DINVVcEwRJoZy8bTPv9U2MBOhkyM=; fh=MBwHuxwh6yL+sD3dXQYTK4fBldS2l5EVzfX2I3gj3Rc=; b=DnASkRDM9aRzWrvrkByAkcT11+O/p4lT0KH9vUAr1N/tWSg7NsbomuROeDWN4hM0W3 lui0KNEz3ATmZ2oDbEJz5Rx45hPYgYokoHo+K4grcpdr3+1kGBQryJm4lzGBA2ITn/SP EdxpbK+In6H1ulSTJxEirk+ImDxrLdob5VbCGaJ1oNYDZyUQYnCXJYX0pd8WnY7bXeb8 CgKUZCO0KovzcsnHSnt1jyRne1Sg4AGHk0WIs8GVjTaXtPNDv0tjn0FM1M4neZCOW8fQ mNKMHiP+HTwUUHycrHW/UI+9cUdS2TjeO6Fp27EsWzfslK5w5PI+SszVfwQG9jZrBdcz c/VA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=K0X5DxtQ; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-178850-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178850-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6a15f307254si125802986d6.597.2024.05.14.08.21.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 08:21:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178850-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=K0X5DxtQ; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-178850-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178850-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 5512E1C21BF6 for ; Tue, 14 May 2024 15:21:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3FF6417F384; Tue, 14 May 2024 15:21:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="K0X5DxtQ" Received: from out-170.mta1.migadu.com (out-170.mta1.migadu.com [95.215.58.170]) (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 16BFA17EB89 for ; Tue, 14 May 2024 15:21:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715700082; cv=none; b=HZT5kk+SqfmS9diMn6MBle5yA4WRIBFsPlLnFWHy30u+E32lfAP3xjmXTOFARu31oqWm1NgUgRnhR5Rp/Ar8AkMsZvB/ewwAXxra9GtnyYXzBsRQ3tXU/+JcSTT2550+AGuO6+uX6QBGQJv9FPY5BmUi414B5IXyfg+MHiMnG2w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715700082; c=relaxed/simple; bh=QvFgEf6xCAOsIIFnMgua9Q/0LKwMRZ/d2SkAe4fO65c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DfrZucLgR8mq4W+YAL2ID9BTyYbpZZl667jLl89OzHGIOIApSLqYeuNuKN0VR+XkB2MzOFO5LjxEK2uaKsRXlPO673J/H7wt6s4bPmjt8ES03HZGKzIUjHiibwqkaSnsg2XbgXHRZHZm4Gpdn5J0ubcMVpLrfBSZ4CdE2UcUop0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=K0X5DxtQ; arc=none smtp.client-ip=95.215.58.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Tue, 14 May 2024 08:21:12 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1715700078; 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=Zp/ZA/wPWSCpzR8DINVVcEwRJoZy8bTPv9U2MBOhkyM=; b=K0X5DxtQL08E3oWIAIjNc7psXoKc+nD1muSUTmbD3yU+iapQASGca7tK62/pJP0vxHnc3j LkzuW8GdiYHx6wnaWlp2rcVRQUWBqMaa3u6Pa/o032bgDTD4FGzqZfUFQgW3Qq53VXO8v4 Yp5K7cKvGuKlIniFkjWCvWLSPbJeSIc= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Michal Hocko Cc: Xiu Jianfeng , hannes@cmpxchg.org, shakeel.butt@linux.dev, muchun.song@linux.dev, akpm@linux-foundation.org, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] memcg: don't handle event_list for v2 when offlining Message-ID: References: <20240514131106.1326323-1-xiujianfeng@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT On Tue, May 14, 2024 at 04:09:58PM +0200, Michal Hocko wrote: > On Tue 14-05-24 13:11:06, Xiu Jianfeng wrote: > > 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. > > You are right but the code as is works just fine. The list will be > empty. It is true that we do not need to take event_list_lock lock but > nobody should be using this lock anyway. Also the offline callback is > not particularly hot path. So why do we want to change the code? +1 to that. Plus this code will be moved to a separate function in mm/memcontrol-v1.c and luckily can be compiled out entirely for users who don't need the cgroup v1 support. Thanks!