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 A811AC433F5 for ; Tue, 8 Mar 2022 15:41:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2E4918D0002; Tue, 8 Mar 2022 10:41:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2938D8D0001; Tue, 8 Mar 2022 10:41:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 182B48D0002; Tue, 8 Mar 2022 10:41:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0167.hostedemail.com [216.40.44.167]) by kanga.kvack.org (Postfix) with ESMTP id 0A3A98D0001 for ; Tue, 8 Mar 2022 10:41:44 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id B32511828D82F for ; Tue, 8 Mar 2022 15:41:43 +0000 (UTC) X-FDA: 79221634086.20.37E89CB Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf02.hostedemail.com (Postfix) with ESMTP id 2802180016 for ; Tue, 8 Mar 2022 15:41:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646754102; 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=J4Mi1zxnZfVXccvQzY1RMVV1+od7uM0sIlTvgeoks5k=; b=WRNKAe3Ygrkg11VcJGK0JdcxpXXbngaYFFM8ij0bgjTea+xLQlV0baSV6ySQk1qHCo4IxJ B9AZ8piw3SsVouiYgQpovhYc8lr5+VDgtXn7el+yn096PBO47NQ24jmKmOyAyM9bxJvvyh WydEwUtocB3t2uCobAKhnFt24tcxSy4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-515-uclafJ5QMO2SbckcCIWUYA-1; Tue, 08 Mar 2022 10:41:41 -0500 X-MC-Unique: uclafJ5QMO2SbckcCIWUYA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 155E91091DA0; Tue, 8 Mar 2022 15:41:40 +0000 (UTC) Received: from [10.22.11.135] (unknown [10.22.11.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id 43FD4106415F; Tue, 8 Mar 2022 15:41:39 +0000 (UTC) Message-ID: <3faa2be7-3a08-ee6d-35e8-c4a35e825c77@redhat.com> Date: Tue, 8 Mar 2022 10:41:38 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH] mm/list_lru: Optimize memcg_drain_list_lru_node() Content-Language: en-US To: Roman Gushchin Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Muchun Song References: <20220308033009.1400464-1-longman@redhat.com> From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 2802180016 X-Stat-Signature: 7twaa1yb5aeurnxrxengn3ze97pd7krm Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=WRNKAe3Y; spf=none (imf02.hostedemail.com: domain of longman@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=longman@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspam-User: X-HE-Tag: 1646754102-432117 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 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. Cheers, Longman