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 D2E54C433F5 for ; Wed, 9 Mar 2022 00:17:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 53DFC8D0002; Tue, 8 Mar 2022 19:17:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4EC3D8D0001; Tue, 8 Mar 2022 19:17:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 402B48D0002; Tue, 8 Mar 2022 19:17:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 326CE8D0001 for ; Tue, 8 Mar 2022 19:17:39 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id F0D09226FE for ; Wed, 9 Mar 2022 00:17:38 +0000 (UTC) X-FDA: 79222934238.05.C73D099 Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by imf02.hostedemail.com (Postfix) with ESMTP id 3737380014 for ; Wed, 9 Mar 2022 00:17:38 +0000 (UTC) Date: Tue, 8 Mar 2022 16:17:31 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1646785055; 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=/MNfsQC78m9BLUcGnHt9G4reyS0BmkH4pO0IBzHcGic=; b=iiptEpK8tsYEgjL8XVi48pn/op9wY7TtsUtnxroTFeWOqFXIoMOatZqnCYoDXxKl7W7IQw bYE7xyoRJRulF1LB4MclGhAiXOkS3OD0cFJyyTT4RJcE1loPDHGpyQXUl3ATOvujFitd01 9e3d0hfM4SJaiun2Ua+NncKBpm77VRI= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Waiman Long Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Muchun Song Subject: Re: [PATCH] mm/list_lru: Optimize memcg_drain_list_lru_node() Message-ID: References: <20220308033009.1400464-1-longman@redhat.com> <3faa2be7-3a08-ee6d-35e8-c4a35e825c77@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3faa2be7-3a08-ee6d-35e8-c4a35e825c77@redhat.com> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 3737380014 X-Stat-Signature: x6dhf54xkkjj5uw9gcbjwoxfde1fac4q Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=iiptEpK8; spf=pass (imf02.hostedemail.com: domain of roman.gushchin@linux.dev designates 94.23.1.103 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-Rspam-User: X-HE-Tag: 1646785058-163068 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 Tue, Mar 08, 2022 at 10:41:38AM -0500, Waiman Long wrote: > On 3/7/22 23:39, Roman Gushchin wrote: > > On Mon, Mar 07, 2022 at 10:30:09PM -0500, Waiman Long wrote: > > > Since commit 2c80cd57c743 ("mm/list_lru.c: fix list_lru_count_node() > > > to be race free"), we are tracking the total number of lru > > > entries in a list_lru_node in its nr_items field. In the case of > > > memcg_drain_list_lru_node(), there is nothing to be done if nr_items > > > is 0. We don't even need to take the nlru->lock as no new lru entry > > > could be added by a racing list_lru_add() to the draining src_idx memcg > > > at this point. > > > > > > Signed-off-by: Waiman Long > > Hi Waiman! > > > > The patch makes total sense to me, however it needs to be rebased at least > > on top of "mm: list_lru: rename memcg_drain_all_list_lrus to memcg_reparent_list_lrus". > > > > Thanks! > > > > > This patch was based on the current linux-next tree which includes commit > ff221bc26bdd ("mm: list_lru: rename memcg_drain_all_list_lrus to > memcg_reparent_list_lrus"). I do remember to double-check linux-next before > sending this patch out. In fact, the same patch can be applied to both linux > and linux-next tree without problem. I'm looking at the mm tree (https://github.com/hnaz/linux-mm.git) and clearly see that commit "mm: list_lru: rename memcg_drain_all_list_lrus to memcg_reparent_list_lrus" eliminated the function with the name memcg_drain_list_lru_node(), which your patch is touching. Currently the function is located in list_lru.c and is named memcg_reparent_list_lru_node(). linux-next is sometimes a bit behind the mm tree. Thanks!