From patchwork Mon Aug 26 08:50:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "zhaoyang.huang" X-Patchwork-Id: 13777430 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 9B988C5321E for ; Mon, 26 Aug 2024 08:51:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 076956B00B5; Mon, 26 Aug 2024 04:51:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 026A06B00C5; Mon, 26 Aug 2024 04:51:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E581F6B00EE; Mon, 26 Aug 2024 04:51:32 -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 C692E6B00B5 for ; Mon, 26 Aug 2024 04:51:32 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 2ED5D140DAE for ; Mon, 26 Aug 2024 08:51:32 +0000 (UTC) X-FDA: 82493778024.08.8DCF4C1 Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [222.66.158.135]) by imf19.hostedemail.com (Postfix) with ESMTP id E2B0C1A0007 for ; Mon, 26 Aug 2024 08:51:28 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=none; spf=pass (imf19.hostedemail.com: domain of zhaoyang.huang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=zhaoyang.huang@unisoc.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724662247; 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:content-transfer-encoding:in-reply-to: references; bh=zrzK7JmlNrydiXwm8WuJSCclkjTJed+nPgI0aj89a54=; b=JSs0ONIDmZv5oDmOMyrhFSOj6NVbR3TKXph0mQFGjD612ntTcLTioce3SAm1VHRbrAvVDM BeoMOcR2IZnV2vPxDvw8kNFREkSNTtFAZkZNvVl02+c7RJOZM0SJBqAJzCJB62/El5Tcmb V55ze2Ds+Mv+8w1WBTiRCB5Gt0dyP8k= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=none; spf=pass (imf19.hostedemail.com: domain of zhaoyang.huang@unisoc.com designates 222.66.158.135 as permitted sender) smtp.mailfrom=zhaoyang.huang@unisoc.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724662247; a=rsa-sha256; cv=none; b=RcYrOVf7wSQPgbX537OptI6S7rFoAH4D8jrFs2e8zAVqcispj2/y/J+XKH7/y584FxRWTS mpkIQkh8C72eqxc6D5pgY8GUSE8B89cVa9RE4rV3qDY1htjbZeMq8py1pEIw8+CtFQ4EhD OUunjmYZO9S+aZMw4HGzqw+tMx83HhU= Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 47Q8p78T092880; Mon, 26 Aug 2024 16:51:07 +0800 (+08) (envelope-from zhaoyang.huang@unisoc.com) Received: from SHDLP.spreadtrum.com (bjmbx01.spreadtrum.com [10.0.64.7]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4WskkG5j2Zz2Nf63d; Mon, 26 Aug 2024 16:44:22 +0800 (CST) Received: from bj03382pcu01.spreadtrum.com (10.0.73.40) by BJMBX01.spreadtrum.com (10.0.64.7) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Mon, 26 Aug 2024 16:51:04 +0800 From: "zhaoyang.huang" To: Andrew Morton , David Hildenbrand , Matthew Wilcox , Yu Zhao , Baolin Wang , , Zhaoyang Huang , Subject: [RFC PATCH 1/1] mm: Skip folio with private data during isolation Date: Mon, 26 Aug 2024 16:50:56 +0800 Message-ID: <20240826085056.895865-1-zhaoyang.huang@unisoc.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.0.73.40] X-ClientProxiedBy: SHCAS01.spreadtrum.com (10.0.1.201) To BJMBX01.spreadtrum.com (10.0.64.7) X-MAIL: SHSQR01.spreadtrum.com 47Q8p78T092880 X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: E2B0C1A0007 X-Stat-Signature: 6bbhjmc7cu4k9y38ntnjzk6cwq466n6z X-HE-Tag: 1724662288-906210 X-HE-Meta: U2FsdGVkX18MiQy9pJvhG/5Thxwt9ElrFYfEgU0cgot7Em6JWBOMN02OA2/MZGKspEkfQLjXQNVb3SQB3owNH+qc7BociWFwIHLoqrmCTR5yCYMkZbwvnXv2rhKnFky5MYbbnWnncZpzO9XWhAGW9U3g8fljpk3w6ptVn8MfVs8BWbnpwHllDgGE74sHp/CPFK1fRYKu4W/E28RR0TLynLPjOSJnZrQLPEOLhAhYla5tCHPRT8lW3Bf2tXtKPRXGts4ZMxhkrbKMuSNWSvg7VwNbhCJ48ir7pK2e8lsLLwh7qJgCEyoMcW6vUeCwT0eXaY3qNwC/Z0QcjSH9/leNXPS5XnbHWzTU3GxtKvMd53hlhnQQRc/U004C8ebRhwhkDaeaBiNowv8Xc/Flwg1/fwqdWw3+ri6WEOjq0T/rjHf6/fVNNQi/qcblzoFTsNI1kzREL5hDC7bYjjdS3KPd1BdY8Uoa+7IYmCTQWnibcjGG0AGkSd/xa3/YDlppFjNF18MhuPTgtvfAbagDFqvDmG++Ij/t+kesmQkZOt29zU1NrK9LpZsLpacOSu5UdvU3OMuuv/NsAK1bE2nFZbAC47A8XJChrv8P/W6fLrWXge43R3c0MsdLZM2Qy3XhgK7VU6i+sDkCw2LkyhCXoRHHpwlzUANK8MWOdjI51veWF9xlKwaLsoK2y2VLDPzBgkTcY9SH67+wIcgyUz5eBubkgkmoMAmpwXMHZh6sx7XaqYMdZPXz05QjHbLEK/jFy1jWWQYOLkrWBTSfkdnIFuLsWpImd/qP6XDU9r6tL4fVCrbw+ut34lszRsU1aladOUIDycGriO4xwMkJPRl6fnQyWHQNNrNVWHmIAPIsBAdD/8TbUXcz4b2apBEU0BFVISvZKg6a809s/rfzExnsV+BpRFIjllHyZJn0tgocYA6Zhk0zxzTrCWDIBLN42UONfHBfJBq/TRpkrR3JtxGLOTb FXGeZxjf Ho6muD983Uqf/9pXJJYWxJ9tFgRDCfsK+VWjV5yKsEyfN3MIMs8YznCQNx0xdjFU5FGx5iaEavWAm9iSFeVYhnvJ/ygHNvYEH+5N9qlThmQqC6LgqMpHukjqLF/YiiCP/tPmgxyT3WUBt+lF0DAYeeH6F1A== 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: From: Zhaoyang Huang Since clean target folio with private data will be given up finally in __remove_mapping as it has extra refcnt, it is better to skip it during isolation to save the slot for more qualified folio. Current one could be the candidate for next round of scanning after the private data gone. Signed-off-by: Zhaoyang Huang --- mm/vmscan.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/vmscan.c b/mm/vmscan.c index cfa839284b92..755bf3a387f3 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1685,6 +1685,8 @@ static unsigned long isolate_lru_folios(unsigned long nr_to_scan, */ scan += nr_pages; + if (folio_test_private(folio) && !folio_test_dirty(folio)) + goto move; if (!folio_test_lru(folio)) goto move; if (!sc->may_unmap && folio_mapped(folio))