Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1816837lqa; Mon, 29 Apr 2024 23:07:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUYnOaw8PwsRqXGgw0F0Mfie6QQBGMJMq2R44JJ2pfeFx7Z5wRoK0PFYgVGE+8OnIFtGiFF/QjCLHGmeWyQPYCeKToDlejLG89ii7/+Mg== X-Google-Smtp-Source: AGHT+IHBVL77FMROZzyg8a5PwLZiMvI1PH37R0P7JKXIr7nEmwvDfBRH8GN4SHFxjfLFMhidtpzx X-Received: by 2002:a05:6402:3487:b0:572:689f:6380 with SMTP id v7-20020a056402348700b00572689f6380mr9740678edc.3.1714457261741; Mon, 29 Apr 2024 23:07:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714457261; cv=pass; d=google.com; s=arc-20160816; b=RNFUUcGYdga/aOKRAHhsyNE7OPIm0H/BlLl96dF1MkmsJ1Im5KilChS37ObTvr2uRM YOYW7IHh7oqlqtdarMnL6hMo7b4FAU/qxF7TzEsyAO2pr4xGU+d9MCuAMMcuDza0YNCZ Y71QSZGdEdbZxoYr9SSv6nud6fTvFKF987Tf4SJ7KsUW/x+Z8SPtPsyVxNi+bCnI8u9W cLboM6YDLI+fS6a0dGBasm3uVDas9lhdx//kYa+v4cltHpJwKkbRUcifAUJWs1fy+aQn jP8bziHKkzWldmRuYHhMrfzHgGv6FUVtgmIVQCp8sB5CEE5iVXxx0mJaBJFh6CGH4kZA AFhg== 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=3q1W7D1q9MXTrJoQi5E1RFDlpl05owU67WZ+nEUBEsw=; fh=wnfKuHOUY4Mz1NUoc5XDTD1KV85duf1XGuItoJ8zV0s=; b=bBbgm26fqroTy8cBdwHAVpd5ThpJDI+K7Uo8RzrnuRFPyjaRARDtbDf8wMaVNuHcQA xhqvdxoFTt879lpdirhY0rSHGyJ42/Ciit6c1ryxiNYr4Ysx7K8QJzNd8/jglDPMprJj 6KbiJu5wluOhNMSKuNn3E+XT9ukCRbCzeK50surjSVAY0pYuATzQFs7LSWBviCfVN2/A sQGZWJeQN+YPzfE6kFpc7+r7gxcZTBJPd8ia2sSzoA/F7cUxILgOaVCK0Y9BsPcOtcfe FrBM6Wvq1mlIoRu1fAo86Ty59dksU6LBi9ULKQ5xGLObE/edBnzwZClGrDD0Z1AhzI9F 5T4A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Zvjx05Vg; 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-163391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163391-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id m7-20020a056402050700b005729e153a1bsi84191edv.176.2024.04.29.23.07.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 23:07:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Zvjx05Vg; 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-163391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163391-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 789081F2148E for ; Tue, 30 Apr 2024 06:07:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DEB0B2C853; Tue, 30 Apr 2024 06:06:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Zvjx05Vg" Received: from out-187.mta0.migadu.com (out-187.mta0.migadu.com [91.218.175.187]) (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 93BCF3771E for ; Tue, 30 Apr 2024 06:06:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714457203; cv=none; b=PioiwAAVFPy+bxF/58EgvMSyHbaq93p/bI6G06uERbujAFgG1vPTEdJmJ96VA3Yfw27zmCW5xUtYu5BRdVV9zbUdcYVHtRSkW5Gsli30eUlB6U+egp1FXU9CVERZK9QiZ4FPh2RcxAjZ4piNsO6lv6PkNORkznKqC//yVJgtr60= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714457203; c=relaxed/simple; bh=Yt6taaOV50WQ9OI6QYKbIN8dZVODj5+9ojwQp16L3iM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aoBeYxgX0XpzhIEvmK0nRsBG0w7bvWfeIO0qJ3Dp01YwkJxhWmdnPVRokZGPP1oClD/0wlXPTZZjO0zKqk5JFuTVEUsk4VU5EhkwZKxzasurx7itxyE9F8XDWaFstYKtujnOEFQp4ocd8GEOO6IQccKYmJFhU6+ijOYNz3lnaeU= 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=Zvjx05Vg; arc=none smtp.client-ip=91.218.175.187 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=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> 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 --- 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); -- 2.43.0