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 6D1C2D10BE5 for ; Sat, 26 Oct 2024 06:26:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F3CF86B0082; Sat, 26 Oct 2024 02:26:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EEBDE6B0083; Sat, 26 Oct 2024 02:26:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DB32B6B0085; Sat, 26 Oct 2024 02:26:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id BD20B6B0082 for ; Sat, 26 Oct 2024 02:26:14 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 0AA9A120AB8 for ; Sat, 26 Oct 2024 06:25:56 +0000 (UTC) X-FDA: 82714767576.09.423E127 Received: from out-182.mta1.migadu.com (out-182.mta1.migadu.com [95.215.58.182]) by imf27.hostedemail.com (Postfix) with ESMTP id CE0D640009 for ; Sat, 26 Oct 2024 06:25:51 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=XNR1Svtn; spf=pass (imf27.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.182 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729923894; h=from:from:sender:reply-to:subject:subject: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:dkim-signature; bh=jhwJgu8R8B7Mg/n0iWKRDn2WDz29p+DH76mo78CE+bY=; b=e4Qr00NePlvJCBmml0f1ToGEVOQLoKBqgQosn98KUaZMxPz7viqcKYjzhG0C5nq4ozDCWs VsRpxadEQNwJBHRjbWxa3uORDd2vFwSZ5WqBu4t14qchdgdseY3wthNxZvLf1DtMG5f2SH 6VVcyXYZC/4j5ALUKVTKOYSAykJfLNc= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=XNR1Svtn; spf=pass (imf27.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.182 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729923894; a=rsa-sha256; cv=none; b=YmFM3ZF1s1ZJmM01LUmRb764hI3IxnNo6O2KXlu2NrYHThDc88TZRZyXXhClPTe/TfkeEQ 8XGCcLZUnWYGchHQhladxw7K82Uc0alw7eKpF7f4FOz8zEE8BNiTKzHMCfUXnJhZKTlmX7 5BIFpTjM0LbGi0Ie8LGr51st+lhXpOI= Date: Fri, 25 Oct 2024 23:26:03 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1729923969; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jhwJgu8R8B7Mg/n0iWKRDn2WDz29p+DH76mo78CE+bY=; b=XNR1Svtnwv+r6wljuv2HEudirb6FZVKbWV+4TDptG7TU0XZF+VshdJgNqeZdCQCm97m4K8 FXm50sKfNEEffjEpL7sdf7kwgX/gNGXwaN+K0DV91H9HrJhUSamBXRQQ/xotuhREY8oVFU qj293ojC4vlQJDrj5sVXdQh0dww+fs8= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: Yu Zhao Cc: Andrew Morton , Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , Hugh Dickins , Yosry Ahmed , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org, Meta kernel team Subject: Re: [PATCH v1 6/6] memcg-v1: remove memcg move locking code Message-ID: References: <20241025012304.2473312-1-shakeel.butt@linux.dev> <20241025012304.2473312-7-shakeel.butt@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: CE0D640009 X-Stat-Signature: 8dy577hxmpm69pxtyg88zfywjs6n3e5j X-HE-Tag: 1729923951-877556 X-HE-Meta: U2FsdGVkX1+bJ3wRDPCr2ES/9ZfX915LjqbjWlsxoMqN+bJA4RYoOnLf6JoEZcGOLa+5iZOBDx5REwqTlWFQ1ntjycpzgHIykwSDatwc6SiNfnKE3pqe2PIxVSAyhrJ/9h+aJCXEo5nuEn73t8+nKPTZOG61cexUSDy6DY1HerO1r3Ow3FJhSpPdNES8q5ZpwcXboGnWSp5OC0Rtx5/57ey2PLb5RA4WcgsuPrBAHzTdYhcoPchBUBefaYJ3PImZObVqDKAA5UBh/oAff+5cuc0YR0whUKY7mX1HwVhKmnGlpWGvp0lvavbWY9FZHwxk+2mi7/3YK/qpYfdt64TrQKhYYDm4g0xciRqew5naENZXybnvOoiFRddNRizzlpRr1PD72JUTT5ObbEbKHxz21f7mnrKatpTQFJIYXVhpfdVO2m0xKq0JuJII7+N5bdIYMjndeiuq449yDLPJAki0/wg0SG5MXWmcuyml1FZqmgrkjK2CzSoxh4Xw6SXYtSrkSA4nlQcslGnEgOLAmW/ascLigrE+LqAjho+NaXOg6MVGk1w0bNhqQ5KZG/y8F8liNA7sSmA3lL/kcp1FX3lR7FqQKIsenIUwyU7CCKVusUmIEY2gu0uPfGF/GWF8XXGYDkTk+iO9yHDxIQNCtL7Zyz2Xb6GkaJBpBIJ6SKOHumjC+6b0VPcjHeAuJYV8qB2nlMFoNxk6SnqBYshXVBv36ZCaBv7uZ3qZ+n34ql9Gb7fow0UQdlKwXk5YoYQSiNSP7R7yxkMgfeOoHGvMrLt+WEpt1B8bbr7Tg45hjDMzQs3PJ33Z2fX3l0oDbFdXqQq6+L4dKNYOqpvUz4PfnG1bV5IAr6mhj3B8sbjbk6AMeMOdVbYCBfTeOACSu4xy3jHNgz36Idr0K0Genja4HSYSQvlxhf9FOBDaU1xWxdpPpI/mxfwKv/zFCGIuPXjkX77Z7VEnd7w6vPn4As+eU4I 7TcuOmYS 5Cxt411713KqtkVSU9xYyT7w1QVN/EDR9NH7JC2lg3ni2NSj+6htM+24k9m1WaC6BG6yY6aztreHS+gc4h0folvHNbvn1Tndx2DqRMif4q1f03xyW9NH3iFGesqOgjjNV10UbTlkQN2vHvZ4V8HFCrOST/iMDBIk1bcrZPeNUibktpAM= 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: List-Subscribe: List-Unsubscribe: On Fri, Oct 25, 2024 at 09:58:45PM GMT, Yu Zhao wrote: > On Thu, Oct 24, 2024 at 7:23 PM Shakeel Butt wrote: > > > > The memcg v1's charge move feature has been deprecated. All the places > > using the memcg move lock, have stopped using it as they don't need the > > protection any more. Let's proceed to remove all the locking code > > related to charge moving. > > > > Signed-off-by: Shakeel Butt > > --- > > > > Changes since RFC: > > - Remove the memcg move locking in separate patches. > > > > include/linux/memcontrol.h | 54 ------------------------- > > mm/filemap.c | 1 - > > mm/memcontrol-v1.c | 82 -------------------------------------- > > mm/memcontrol.c | 5 --- > > mm/rmap.c | 1 - > > 5 files changed, 143 deletions(-) > > > > diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h > > index 798db70b0a30..932534291ca2 100644 > > --- a/include/linux/memcontrol.h > > +++ b/include/linux/memcontrol.h > > @@ -299,20 +299,10 @@ struct mem_cgroup { > > /* For oom notifier event fd */ > > struct list_head oom_notify; > > > > - /* taken only while moving_account > 0 */ > > - spinlock_t move_lock; > > - unsigned long move_lock_flags; > > - > > /* Legacy tcp memory accounting */ > > bool tcpmem_active; > > int tcpmem_pressure; > > > > - /* > > - * set > 0 if pages under this cgroup are moving to other cgroup. > > - */ > > - atomic_t moving_account; > > - struct task_struct *move_lock_task; > > - > > /* List of events which userspace want to receive */ > > struct list_head event_list; > > spinlock_t event_list_lock; > > @@ -428,9 +418,7 @@ static inline struct obj_cgroup *__folio_objcg(struct folio *folio) > > * > > * - the folio lock > > * - LRU isolation > > - * - folio_memcg_lock() > > * - exclusive reference > > - * - mem_cgroup_trylock_pages() > > * > > * For a kmem folio a caller should hold an rcu read lock to protect memcg > > * associated with a kmem folio from being released. > > @@ -499,9 +487,7 @@ static inline struct mem_cgroup *folio_memcg_rcu(struct folio *folio) > > I think you missed folio_memcg_rcu(). > > (I don't think workingset_activation() needs it, since its only caller > must hold a refcnt on the folio.) > Yes I think so too but I will send a separate followup patch for that.