From patchwork Wed Mar 29 10:47:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "zhaoyang.huang" X-Patchwork-Id: 13192296 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 09176C6FD18 for ; Wed, 29 Mar 2023 10:48:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 515E86B0072; Wed, 29 Mar 2023 06:48:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4C5C16B0074; Wed, 29 Mar 2023 06:48:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3DBE96B0075; Wed, 29 Mar 2023 06:48:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 2E9D06B0072 for ; Wed, 29 Mar 2023 06:48:21 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id F305AA059E for ; Wed, 29 Mar 2023 10:48:20 +0000 (UTC) X-FDA: 80621611560.30.13C2565 Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by imf23.hostedemail.com (Postfix) with ESMTP id 45E2714001D for ; Wed, 29 Mar 2023 10:48:17 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf23.hostedemail.com: domain of zhaoyang.huang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=zhaoyang.huang@unisoc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680086899; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references; bh=JDsgX5hU+79t1EGeMejbU9n1MCVJlPWcOjWCjqkX9Qs=; b=tAQp6h1YjJNIuP2ptLB7OITsYg/ir+ZyuI/iXWWxvkBe8S2Jgy1w//GVuFA1wVqUNXXV1K Wjtl0tkUI7F4vKvrq8wnqA9EE+2ugbuErWddJ2/NRQoaWVgzlHLijf6X3nWIwYzgwaGl3T 9KsziVdE1mnef1fFNn8r5p1tQfi0Ruw= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf23.hostedemail.com: domain of zhaoyang.huang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=zhaoyang.huang@unisoc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680086899; a=rsa-sha256; cv=none; b=6tcwJt9Wi4m6UHxIy9ZKNtaCuI2qf800VP4Ime7RgrfwtpA7IO+0wbn9EPCwwwAxKJuyJK RAlwPzMoka7Ygh+aT1hXGEKluY+LHncfpAjfRUYkvmZ/VhZNVs9pIkS7h1I9fPNjZH4WtY J0o3cfNd/2c/TampOwqFOm3M65nvP/4= Received: from SHSend.spreadtrum.com (bjmbx01.spreadtrum.com [10.0.64.7]) by SHSQR01.spreadtrum.com with ESMTP id 32TAlrt7027417; Wed, 29 Mar 2023 18:47:53 +0800 (+08) (envelope-from zhaoyang.huang@unisoc.com) Received: from bj03382pcu.spreadtrum.com (10.0.74.65) by BJMBX01.spreadtrum.com (10.0.64.7) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Wed, 29 Mar 2023 18:47:51 +0800 From: "zhaoyang.huang" To: Andrew Morton , Johannes Weiner , , , Zhaoyang Huang , Subject: [PATCH] mm: mark folio as workingset in lru_deactivate_fn Date: Wed, 29 Mar 2023 18:47:35 +0800 Message-ID: <1680086855-7989-1-git-send-email-zhaoyang.huang@unisoc.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.0.74.65] X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX01.spreadtrum.com (10.0.64.7) X-MAIL: SHSQR01.spreadtrum.com 32TAlrt7027417 X-Rspamd-Queue-Id: 45E2714001D X-Stat-Signature: kqf68wdqos6t73shtmdti8nx337p7xwx X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1680086897-431721 X-HE-Meta: U2FsdGVkX1+owHdjAqm3vt0eo7BLvdMsY8OvsUhTJq9zHC4K5sgVy9SPPc8xalGKAX7tjuTgYf22tdVUlzkSD2xoURGqDzQ/w5i/dqDYP1qprQKhPiA4GfFqo9MsJ4n3C8s3R46jCGth/ckSvqUkjxPpIgP4OLYR0KRh1KIS19IfYnRLAaiYLj/pDFhyn1cCy84om8Zz21KK6wjSU0KyFUyeXqicPEDnbQ1xUWtUHKa/jYbkkvWiNlfr3n2BaUy7LhOQk9OaDX94kTITL9O4Shz2kDlPDneV8Esq4vuvE1UPoSnkCNMQD6l+IY/pyU3I1GPyh1yuRST99NNOXU2Fn5f3s+cLTG16cDKfHQyJbAufqpiSiIPywmwWVjz9IRLYKcXlvv+6vC2DKR8ZdBtB8Yz8n9VlHRQCf/DL8hcdJF7AnyXr/weG7zsV/ZTLNsKxtO7UbWdPq2S0bovuimLBN6pPibQum14ZsR60OAHzjlT2Ns26HNaehqZgwDo1Diat8+xU7gxMm3ZaTn5rq+yHaLU9LuWQaYJrD6qvrdxyBaTeBHuQDCQS4zn1iAcQ2KCxm8nFbBi1YCPeeIDBN3eI0WnLuGbLpmyXS1cZRjbH4mRR1HpqLig6ITOhc4mnpqYrFGO24aOIYrSoAZtbzhNJo+HYmjlktcQnPob+BSsQm9Xpq9Ki7oZmGJ+FQ0rzlfgfY+BsYIpfCP4Ao5VY0Bv0di6HkKTlTrTZT9Qald0fUFLt84O9ucIOceeRNGKUUzJQnQdxcaCW41kJ8usmJxOBL33nky92M7vVyBy6EGObpAPrUO/27nlvNLAMwfilVZV+tsh1rrpFNk11dfiqFNq2onc6GmW8X3GWVzd5pPxV+zcCtnBaAbG4im65srCrAVtdyguRnGZ9R7oN0JU9uzymbM98puJlgB+e/qh7VfqgCcL+/i12rXat43nnNR1SNn9eSL3TnZnMCMSkUAKhihN Hmslhk9z eBzkRIRf6HY8tpEqWiJGpP2fgZy2RznGLaiMHC+7+LMJ5wXfKcZCXWLZm6LEBa16eXJ6PAjZBbm26XapbrAQVtwsPvU+G2d9wqfOSfeVF3wlfjGOBi6FwdjVfxe3spChxtimuzyFRqSrOMc44D8b2Cqt1+8hpiol0hd+dxew3ugH2f2NbK9DcAkyTtokteDlgCzlEnmtfa9vhXujzc53Puxtaqeq5L+XSGBe7OHv3idqFAAOKPNQALzzyFcFROfiiQO/68EZXHkj6EXiLJb6pZVmTW7940A8lIRbeA0odmP2sHrAxfDPtbH9JcBH6DOOOz9MjaVKbOqo4XxUWcL7H+UqgSDWj/t9Yi49BgRucogXXj6EOjgmIxZwHlg== 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: From: Zhaoyang Huang folio will skip of being set as workingset in lru_deactivate_fn. Signed-off-by: Zhaoyang Huang --- mm/swap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/swap.c b/mm/swap.c index 70e2063..4d1c14f 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -603,6 +603,7 @@ static void lru_deactivate_file_fn(struct lruvec *lruvec, struct folio *folio) lruvec_del_folio(lruvec, folio); folio_clear_active(folio); folio_clear_referenced(folio); + folio_set_workingset(folio); if (folio_test_writeback(folio) || folio_test_dirty(folio)) { /* @@ -637,6 +638,7 @@ static void lru_deactivate_fn(struct lruvec *lruvec, struct folio *folio) lruvec_del_folio(lruvec, folio); folio_clear_active(folio); folio_clear_referenced(folio); + folio_set_workingset(folio); lruvec_add_folio(lruvec, folio); __count_vm_events(PGDEACTIVATE, nr_pages);