From patchwork Tue Apr 30 06:06:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shakeel Butt X-Patchwork-Id: 13648292 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 EA23CC25B10 for ; Tue, 30 Apr 2024 06:06:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5BDC46B009F; Tue, 30 Apr 2024 02:06:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5446D6B00A0; Tue, 30 Apr 2024 02:06:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 370326B00A1; Tue, 30 Apr 2024 02:06:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 14C1F6B009F for ; Tue, 30 Apr 2024 02:06:43 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id C7055802B8 for ; Tue, 30 Apr 2024 06:06:42 +0000 (UTC) X-FDA: 82065164244.02.F4C5BD6 Received: from out-182.mta0.migadu.com (out-182.mta0.migadu.com [91.218.175.182]) by imf28.hostedemail.com (Postfix) with ESMTP id 2095BC0028 for ; Tue, 30 Apr 2024 06:06:40 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=Zvjx05Vg; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf28.hostedemail.com: domain of shakeel.butt@linux.dev designates 91.218.175.182 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1714457201; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=3q1W7D1q9MXTrJoQi5E1RFDlpl05owU67WZ+nEUBEsw=; b=jEE2WytLx/I7r5M+FMwkjOVTU+kdhmF+vru6OnwLbvWkqZJPXHfosuO7N2aTj10DyBx3RK 6rE6ciBt2qC+9/AJKqqWMdQbabbwGlUTbKXBwEHwDU++hnbWVnTS1ytM7RUN0bxsWDffzx TNYoauAtlUvWo72FXGmroDqasTh7xJs= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=Zvjx05Vg; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf28.hostedemail.com: domain of shakeel.butt@linux.dev designates 91.218.175.182 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714457201; a=rsa-sha256; cv=none; b=Ih9JpcGwLukqJVcOwNZeBTn1pBTQdK5Wvfkj+02JzlliYLVRWQfVwe+jye86Sy1qzKy0Kd nQe54rkwtpmvgwsT1e9tDwJTFW5zEoFaI2pe9LfAYv/X1xpR9PV1qSu+L7VJxWFieUW9RZ lXx1UpzOatCO+3K07CJ1Y8TF23Yrqwk= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1714457199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3q1W7D1q9MXTrJoQi5E1RFDlpl05owU67WZ+nEUBEsw=; b=Zvjx05VgmEQtihTxz/c69px6v2O5rBQ6CAXVV5XJDCN9QIGwtVdWfgW0aW1WLezr8zeDVJ zKAt36dlwhmlOfD/FK11SMqB6MnAnnB0oRd07xODCZ2IYBioYy8jixmJkk1+4QTpOQfCkT WFnehtYOPj0Jpa6WCliKDbOMN+qGLUo= From: Shakeel Butt To: Andrew Morton , Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , Yosry Ahmed , "T . J . Mercier" Cc: kernel-team@meta.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 6/8] mm: cleanup WORKINGSET_NODES in workingset Date: Mon, 29 Apr 2024 23:06:10 -0700 Message-ID: <20240430060612.2171650-7-shakeel.butt@linux.dev> In-Reply-To: <20240430060612.2171650-1-shakeel.butt@linux.dev> References: <20240430060612.2171650-1-shakeel.butt@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Stat-Signature: rc66dky8xha9piy13prjiidwhm1ipi8x X-Rspamd-Queue-Id: 2095BC0028 X-Rspam-User: X-Rspamd-Server: rspam12 X-HE-Tag: 1714457200-761931 X-HE-Meta: U2FsdGVkX18BFh0TdmtcS7HQFvyXBCjmkFqngobgMBpgdoZmBHANKc2EvSUAjdeZBgeK/Bm9v5YQcJuGYR8AEhU+++/AoFU5BrVeBKMmdO8G8n1YOAnhejgIapVsD5UF5bYxeMIbFP5ixOyHSLrYFsEMfPL9Ht39Rgu12aTlfleYnQTcULc4aiLWnRV4oriRMkWcC1rC2rNISsREoCemHJp6rqr3Pz2gQzOWT7jMITuIZiIpZIec4AFzMg8eZwOHw9+WutiiegXZ4FJOzMAp1rvUL+IZv/1HEeMXM3LGwQJVmCQnEV9WqJMuzAma1mnzfYOCAumBuz+BZ0jAW5P/buINxL6JYYgILfnmF4gHAjeBT4qb98J9niHobIAYJ9VqrErgQ5vFcfAXRllxjDqQ9iWwTSeDrObmNiHr66OGZcUemVJ4MkfkI1kui9fChLzyAQqMpNQutwKe98U94tB4J8UDcVsJYzcy39t0PESpQY1L+ZethBSIge0KtljuYMpX+csINvBE3A9buuxcnqoXyGuKcIS2KQZZI+1BbF1I0dF7mPsMT3tX3yUkJqr/xayWMC0dsj4h0ro1nJmKc3p+zsuWfv09sCoqp1XZOmuAaKD2/SEhjs1dNktEV89k+QnjKALf0egSVypGRI+88MdxHsEx9vE+u2B4Yb6AesfJvP+Epka7Vj0pVTTXjW3FnYiURVrOZyuU6mXFAWaDGsUH3OiE6bVg/AqdE/Q3eaew3rYhGJ6inP3I5AbSvJZXqljY37MBm1b9rCW8NkvS9X8iGwlmIToSetPTSKOyiKvb0BYCgrSYy4IU3+wituo+oy6I9XJRtHONkTg964adptsK7XyDNi+0CXMtShLDD8brecGb8UcNNuFmDwRndgsNlCJsDqD+1BdhHjwPgqqVwpz+HOnIJwE9914fni/xWY5E6CYK5aYjNfzElCgseHN75D1vBBOeglvsqgnZVjepATw +rPMxenL EQDZS6XwmQWin82+9ewy9SCFKfRI4uPOgEjn37LtIvS1XMkaVJVD7uU1iEYptDAaEy89rVm36n9y40+iQKSYerLMjwioVlhoCZlIOnTzrkZuileakcGhlnOKALVE/Nxop7daD 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: WORKINGSET_NODES is not exposed in the memcg stats and thus there is no need to use the memcg specific stat update functions for it. In future if we decide to expose WORKINGSET_NODES in the memcg stats, we can revert this patch. Signed-off-by: Shakeel Butt Reviewed-by: Roman Gushchin Reviewed-by: T.J. Mercier --- Changes since v2: - N/A mm/workingset.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mm/workingset.c b/mm/workingset.c index f2a0ecaf708d..c22adb93622a 100644 --- a/mm/workingset.c +++ b/mm/workingset.c @@ -618,6 +618,7 @@ struct list_lru shadow_nodes; void workingset_update_node(struct xa_node *node) { struct address_space *mapping; + struct page *page = virt_to_page(node); /* * Track non-empty nodes that contain only shadow entries; @@ -633,12 +634,12 @@ void workingset_update_node(struct xa_node *node) if (node->count && node->count == node->nr_values) { if (list_empty(&node->private_list)) { list_lru_add_obj(&shadow_nodes, &node->private_list); - __inc_lruvec_kmem_state(node, WORKINGSET_NODES); + __inc_node_page_state(page, WORKINGSET_NODES); } } else { if (!list_empty(&node->private_list)) { list_lru_del_obj(&shadow_nodes, &node->private_list); - __dec_lruvec_kmem_state(node, WORKINGSET_NODES); + __dec_node_page_state(page, WORKINGSET_NODES); } } } @@ -742,7 +743,7 @@ static enum lru_status shadow_lru_isolate(struct list_head *item, } list_lru_isolate(lru, item); - __dec_lruvec_kmem_state(node, WORKINGSET_NODES); + __dec_node_page_state(virt_to_page(node), WORKINGSET_NODES); spin_unlock(lru_lock);