From patchwork Sat Apr 27 00:37:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shakeel Butt X-Patchwork-Id: 13645519 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 A5633C4345F for ; Sat, 27 Apr 2024 00:38:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2EF996B009F; Fri, 26 Apr 2024 20:38:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 29F6F6B00A0; Fri, 26 Apr 2024 20:38:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0F37F6B00A1; Fri, 26 Apr 2024 20:38:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id E35F96B009F for ; Fri, 26 Apr 2024 20:38:07 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 695F412021D for ; Sat, 27 Apr 2024 00:38:07 +0000 (UTC) X-FDA: 82053449814.24.7DFD8E9 Received: from out-182.mta1.migadu.com (out-182.mta1.migadu.com [95.215.58.182]) by imf27.hostedemail.com (Postfix) with ESMTP id C592440005 for ; Sat, 27 Apr 2024 00:38:05 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=SncPF2vo; dmarc=pass (policy=none) header.from=linux.dev; 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1714178285; 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=XaVmG+nL1Z/KgIhQvtyGGfErTWQGfN9RM5fOWCMfM60=; b=iLjax5SLqb48HnKHmpv4/7aMRUk2vriVeo/ZqQM7V/bmgLnyVoJL8PFj+9oDJHhF6yzOh5 fooiTjbPQ4mtPNlpoIuv22CBftslGzkWJpHDl1KTQL1RrSGb6jcvv6HjxqnZj4/IU0ohJB mRPtQSPWktKwwkI64SQ3IfsstVLTu3w= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=SncPF2vo; dmarc=pass (policy=none) header.from=linux.dev; 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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714178286; a=rsa-sha256; cv=none; b=Kun+ejlleshwLmubyCV5lL92MzEgCcm8oTOMRT3E0rG1/Hi6lgsU3agzXTRPMawUMU9t+9 kiDUI59MdfQndQbrzhWooBqXnZafTp4PT1nywKJNfhOehZQRpWA4gXVXuix6LoikqoTEJP LC06Zy3VvWx/nYQtgppP4l4vW78fqX4= 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=1714178284; 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=XaVmG+nL1Z/KgIhQvtyGGfErTWQGfN9RM5fOWCMfM60=; b=SncPF2vo7Gj5pGR2HtW7z18CEr5iYUMsR9J3GEV4lMaLOx6+PYwok7wMxTGAqdmd/XJczt pZgDrZ1qNeEJIRnvjIs1Aeyf4VLQRcEnJYOnsAE/Dy3rzsexN2xS0tWE7DQUd+u6a/yuZU qWm6PPDolOHny72+IBIloElPU+qJuFI= From: Shakeel Butt To: Andrew Morton , Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 7/7] mm: cleanup WORKINGSET_NODES in workingset Date: Fri, 26 Apr 2024 17:37:33 -0700 Message-ID: <20240427003733.3898961-8-shakeel.butt@linux.dev> In-Reply-To: <20240427003733.3898961-1-shakeel.butt@linux.dev> References: <20240427003733.3898961-1-shakeel.butt@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam01 X-Stat-Signature: s5hzsgoykws6ehniip5n8uhydt6j1czq X-Rspam-User: X-Rspamd-Queue-Id: C592440005 X-HE-Tag: 1714178285-515199 X-HE-Meta: U2FsdGVkX1+ZdOgDjJcVN+uIURLxvHimQsujzSjyRInsU9niZ/ApVVhoiiPoIMZ8HzKPl+xZ8Iz0Eo7QZUbhiwO0w/HmHHAjx4qQthKPYwq5r81osvYujnxL5fqMzqtS1I4YCt8eiYR6uJwkxtek0+EjXhsY54nS+kTqccSTXPTR3nEACI5bFZ20JDqsujwxCjw35/hoI0ZyWjRzc3rACRwUV+4wG/ZTsAxZfk10BaAZpcBkgefe6fQlfoNPTq16cUtfBuB6pNJsh6A0xF/4GNyv12754vU9hlD+yGKXhPCfU5wj3LLlRrxe96W8EfMDOLy7ZePCCdShxvNf+yu9lvvrBUkiVhx6CNTZyUCxgmUt4ak8bKonps0dauraB6sSZb+yNWuoo+x90fGnWf7RdowGGLoRz1XT+F7QbcC3NbC/Qzy2l5/R/dgenKthcFE14kiI23IeE9f9SLPh065f2fb/AAOo83AWeuJWYmBBQgq+xmfb7O+zp2N7krRiKx0uBc5ig9f+mYgQ37m48ksW7jCMLu5sggQlqnCjgP9IZXKg+HIwj+QypbiyWAnGoFfXn0vEP4PF5B4x4Vmz9Wp17ML3tK3LXYYDTl+ABdyr60Nc2YNjC7m4BIWWQPPBuV29csXxBmkPH2qImYvbI2sMrd2xAt27SbKITwcAU97//0JytjR8f1M+wwp33b+o8lmN9pCYIlBy5DtC5Y0mgcfHNHsswewDizNvYVreAR6DQDzWh6gQiiMQa3gyHFJTv2bUgjtSX5tv3Un3bZiSAe1TBSi/BvpJ9RW7Bp2uU6TKE4fMfOOkCC7nyjEk56ApwS6gEz4oTQOr6cNXM5kSqz5/jytmA4JDiIEZOaPvTrpCm4OosMBPjcQuUghnpCDhb25mKrevW+P0qKpZ7pDRNQvXk7BpF+aYrRmGn10HgZguGdNCNeSg84RAtY/1TQSMTZL3WsmRM7csVLpGT7mJONX y30/oqRq IlagIwnaKQ6ZprEryi8p4h5GCi/QgMGaqlcxmGSVwP0mSTkjK6VVsIWws3hkPg3ydgsk9FT2f0MPhJaexBxIapASCu3ZgJg9/3YLkK5hLf8kAmmlEB77bk3LZDDMov4zkte7j 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 --- 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);