Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp132562lqa; Fri, 26 Apr 2024 17:39:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU8SKRhecPvh6vrDgO9xDWQAl++1eDLyErrNIeFIQW+xgKmtlymugTOz5F3XYNZvPuE6Z+CriBUNu2YQ17fnRvYKVXNnCRwB3cAzKcJPA== X-Google-Smtp-Source: AGHT+IEdh+CCWoMIgEyWOjXKGO/9JC2lwjNUsVAQrrVhiik95JJGGOCh2no5cFjtFFm+wZK/o9Q5 X-Received: by 2002:a17:906:378d:b0:a52:1770:965 with SMTP id n13-20020a170906378d00b00a5217700965mr2702961ejc.42.1714178371052; Fri, 26 Apr 2024 17:39:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714178371; cv=pass; d=google.com; s=arc-20160816; b=hpZTVnX5btyBkfD6Z8evrBICTKV1lz9qIs/Rp0vUCqHkANC9hQjFlckA/OK+AnUmun TpycFX8q31ZbpnjNmflpJpx7j27Z8sHVHtC7Jt0+6GklXBrCFQNx2KVujZ6t7aePwjil hKqwLBYSZva6x83F0t/jbAnkjFXpcKOuirU5RRMvmcp8z3n6uwq4aQmiGQDMdphLQ0xQ VpioTBvTHm6edexZi6MEK+8Ya8hjJQgnIBFqWZuoMaK7HRGbRc7/FO7H19LuXZjou/7t KNQLAImOkFo3eMIG9c/oAzOjkmxVo2XBNASxqQ3fYoUzcAMzMMejWZwbUeDbOSwP6/Zd hJpA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=XaVmG+nL1Z/KgIhQvtyGGfErTWQGfN9RM5fOWCMfM60=; fh=RT6qUd/cFk7mA1daRZyPKZ73SkJUv705B/3NiEK9oSU=; b=RJQbSGH9XAfRHskpOI7PYczlu5u7PL/eyXH+LD3Dp+/PiKUtfssSLuC60dYEV/ebEE wQq0KgZRY+4w+UtBSAEAQtPUDrlhnBRXNoNpjcLkkp9QZCuRsQVrAY+WYdZqPW+cVFgi mC8vBjzCXQ+vYmlX3b1FvMjKHsI2p542pWmZGE0TCqAJaDJU/1vk1WJTgF6Y5TJ7NoNp Gj7T5nEvypDyiujePZYVMQKF1j13aZ2Xj2ZkmgKZnM4chrlMC/VZjGfRUlwAcU0oO2Lp ifDy7S79mLS3o6KvV77e11tDC8qoOs39u7GVG6g7tpcsLB7CSRFIL62be6Sd+huMfIzc 2kig==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=SncPF2vo; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-160826-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160826-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id rv2-20020a17090710c200b00a4e2296aa76si11610361ejb.899.2024.04.26.17.39.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 17:39:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160826-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=SncPF2vo; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-160826-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160826-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C24BB1F228EC for ; Sat, 27 Apr 2024 00:39:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 60CE241744; Sat, 27 Apr 2024 00:38:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="SncPF2vo" Received: from out-189.mta1.migadu.com (out-189.mta1.migadu.com [95.215.58.189]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3DD9B40847 for ; Sat, 27 Apr 2024 00:38:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714178287; cv=none; b=uyBpr//ArkeDU5KJled27LKWSpWe84TwowkM2aJiWodQ7gVWmrtleHeMLxA1zqIfH+2udu0PP2Y5Ok2MP+iIUOKAXXSKDyCk5NeC+khca3TBCTBfy10+I8NyBOx+8DbD17Tby6sjZ1/U5uKcd8SbGuvyBoRczUWy5KjdRKFU0rE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714178287; c=relaxed/simple; bh=dkznO5UFLYRjlvo6rhP3U2XgAo3NdmOtc60UDRFxx54=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X9Gq1B+nVTq8zhUpLgOW90AAmKctRS+wPwRaLRfdX+y5PuWBli9+4626OaUgzIPyeTLpKUSmVw9upHbF9Hp4r3goqMoL85AEX+B37iqSomj+7VNiy3yWKv5Rip/L3Gs6SgNuyqJq8bGOadYEguMRr14VCvoiRkCtBa+2kNlN2Xc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=SncPF2vo; arc=none smtp.client-ip=95.215.58.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT 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 --- 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); -- 2.43.0