Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp622889lqm; Wed, 1 May 2024 10:29:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWssHH6BqT6iyr6Fd4C4dpunww7jbF+FmFvqX86+I0Ai0HpjafAl6Sf7tGxrYJX/ypys5qQ+hvmhHyDppHkLV9W0Od/OEwPwRhak2ypQg== X-Google-Smtp-Source: AGHT+IF1T4JpUnc84w0B0fNdi7y/jAPvM4FmgB4+hO7SdD9/xfp19SdfpAVFGSZW/ENJY0XuBXuC X-Received: by 2002:a05:6358:7f12:b0:186:27ce:639c with SMTP id p18-20020a0563587f1200b0018627ce639cmr4723865rwn.18.1714584556097; Wed, 01 May 2024 10:29:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714584556; cv=pass; d=google.com; s=arc-20160816; b=DIXaacakRDM95QB9s1bhNeOmZbmMAvm3DPNXN4Si0oLdlxtEw31Il+ZdI6FQKgT5jj ZVkrV43zbpMN3SxOn9J7no8vG/bcSWMPzIHMuKOhYRFvJeDwT04N8KrKG69k4B/qIB0j QGcWxPD5PPT8DPqBCdP3dwZH6b9FBAu1FDm6AHq9BghlMpflBVZymSLGBzoSnpq7PIbB QYAHSu+hvhMpp2MO/hQNzf7qIZUD6dbLV/Dyn5FAMIxKI1MUR/YI4onB7BkxvhNxgezy vhBZQm7PKf6Saxg+lbmjddBG8d8qit1IF9fujzbnCvSlBpnYDMxyVzZNcq3REypMwsSe hXXQ== 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=y9l4h9rie3ivYcnawsodk45GJOrF/TCVwGQRSWBbU5Y=; fh=wnfKuHOUY4Mz1NUoc5XDTD1KV85duf1XGuItoJ8zV0s=; b=nBaaeZq7ORsszK1KyHbrFtnwI7UdtxRbTDLBHGqHQnFToV7jr12E5qWwfWuCOafXLz +T7FeNFITR2O/RGfud6wE26ggBfctdcSCIF3BQQk3zhwmXsHKZ2FGLTtLymxfxvIbB6a l1LR1R7XY9oORUXo6hBZVYUI/mxshrLqAu+Cbk8sl2c5/UqW2OS6KN9EaFmeeVz44hXN ocfJ58YvfEZZSRDbKN3VEwC4S11bGiet/7YXoFihuUdOiV9a305UDpPRHExW/CUbomdL DmnyBEXONEzElHRfYpbhJdE4wHRG0/Fiezn7Su6UwMOLsyfgVPPy5jG9dN+kdw3uKm0q 6/7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=YllzTqli; 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-165648-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165648-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id k192-20020a636fc9000000b00613b9e3a6f4si6374620pgc.541.2024.05.01.10.29.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 10:29:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-165648-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=YllzTqli; 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-165648-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165648-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id CF24BB23115 for ; Wed, 1 May 2024 17:27:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 10755130A42; Wed, 1 May 2024 17:26:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="YllzTqli" Received: from out-176.mta0.migadu.com (out-176.mta0.migadu.com [91.218.175.176]) (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 9D49F12F379 for ; Wed, 1 May 2024 17:26:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714584408; cv=none; b=O1owgCbkoLSEGjG3s5Xd51rYJiLp749PQEa0JhYAE8/+oBU/x8BFBtwOfBbVgL09Grd4dbuwudTOYMwvNDWrMjiVHV1DHrFl+/fmArP90ojebGakKSsHbZk90GtaVTZZq2zGWM1HXlv9ObsK/X+SlEncb/Mcw6QOaHWjOMc+wuo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714584408; c=relaxed/simple; bh=arC6n41tJkWrwWejZ1VKD8GPi7GOBBb6+HRk5RjjI/k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Fbf5DW6suLBIyU+KhojloQAIaz/PUBH9q8Tx5OUgomAhQSBLZRtzRtwXaYKOC5e5umwVDJAqTte7UrjY33KODmGEgbtM7sbi40cJvEstZAySd5hM1EFGLTJo8iLc8eRSknSJ9G94mRkkZ93/v9Uk0A9t0a0YISg8KOjRsZ0d/s4= 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=YllzTqli; arc=none smtp.client-ip=91.218.175.176 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=1714584405; 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=y9l4h9rie3ivYcnawsodk45GJOrF/TCVwGQRSWBbU5Y=; b=YllzTqliiBcI+Aeoe8N7nlIwm57TMV4GBbDUW7Gs09N6g0ncTSgttX6g5AuD2XQq1L1kKx wwfv4dy2Hbq8pAeX2MHK9w6Z6P0ndH05+Ncdg1vb5QCnTHF9BevviekazDKX8/0cJw5QhC b+SnksRmtYa+1xk4xF+paE+q/1cuoI8= 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 v4 6/8] mm: cleanup WORKINGSET_NODES in workingset Date: Wed, 1 May 2024 10:26:15 -0700 Message-ID: <20240501172617.678560-7-shakeel.butt@linux.dev> In-Reply-To: <20240501172617.678560-1-shakeel.butt@linux.dev> References: <20240501172617.678560-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 Reviewed-by: Roman Gushchin Reviewed-by: T.J. Mercier --- Changes since v3: - 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); -- 2.43.0