From patchwork Sat Aug 26 09:22:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinjiang Tu X-Patchwork-Id: 13366540 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 DF8CDC83F16 for ; Sat, 26 Aug 2023 08:28:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7DDCF2800F0; Sat, 26 Aug 2023 04:28:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 78EE62800EE; Sat, 26 Aug 2023 04:28:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5E0DF2800F0; Sat, 26 Aug 2023 04:28:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 523B42800EE for ; Sat, 26 Aug 2023 04:28:16 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 22AB312015E for ; Sat, 26 Aug 2023 08:28:16 +0000 (UTC) X-FDA: 81165578592.11.E10B7D2 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf09.hostedemail.com (Postfix) with ESMTP id A6535140010 for ; Sat, 26 Aug 2023 08:28:13 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=none; spf=pass (imf09.hostedemail.com: domain of tujinjiang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=tujinjiang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1693038494; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QuyBgHit9PHzHFB77zJ1j41runvAieSvfr+traiMSq0=; b=Yx8xA82ScdoAY6OiO0UkHEm7kfUwYnB6N9K7aOT8qu8B7QwMoBfZgD2/7XfyGdqCjz6IKA n+jlmu9fN5vBTK8Wa5CxGUPeH5+7zOqbmKW/bioDRFXqegKv62/sU1SJveJXNg8CG0CLuP lVMr8a8Wkro0bWnbjr6vJzlJywjJ6OE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1693038494; a=rsa-sha256; cv=none; b=ef2yCAhMRS8IukFWCAxVaMiZp6basomHmpQ0ss6NXYJgMdveO9cEJlX4uEaig815CKnAut Ka4OwdKY8Gomn1QDeJjO1lEeXkPxVqCfHllYRTl9ySJJTMp43Iw2/vhO9mpzedbdz1fpH9 1DyDaxRXPfoC9KX/F7C4+m6ZfSGDyKI= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=none; spf=pass (imf09.hostedemail.com: domain of tujinjiang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=tujinjiang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from dggpeml500011.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RXqfc2nm2zfbxf; Sat, 26 Aug 2023 16:26:32 +0800 (CST) Received: from huawei.com (10.175.113.32) by dggpeml500011.china.huawei.com (7.185.36.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Sat, 26 Aug 2023 16:28:05 +0800 From: Jinjiang Tu To: , , CC: Subject: [RFC PATCH 2/2] mm/gup: remove folio_maybe_dma_pinned() calls in shrink_page_list() Date: Sat, 26 Aug 2023 17:22:40 +0800 Message-ID: <20230826092240.713105-3-tujinjiang@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230826092240.713105-1-tujinjiang@huawei.com> References: <20230826092240.713105-1-tujinjiang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpeml500011.china.huawei.com (7.185.36.84) X-CFilter-Loop: Reflected X-Stat-Signature: bs3jtc8xjkp33kxoztbe1dateznmhzf5 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: A6535140010 X-Rspam-User: X-HE-Tag: 1693038493-946187 X-HE-Meta: U2FsdGVkX18ma96QHKkGnQAWAU5zYs17qnnHkyl+uH1EYz/ofQVfTZQTdViemmNc+nz2bfXiOuarjIVCOKhnNn3vFTQl1I8/m5y158weqW/cJS4YmWg0LvZdiUaam+5TLdM1L1n1fqX+Ylh5taUaux/nhSR9hD45YiAJcGu7PpFzsUP6hlyFCTNC/4kXVDOYUZM/PE77kirTcnsnLwgcrt5n5xnhcIX7LxUPTks8phNPX8LxFL0+xYamn6LgFuZ+bGFY4GYYLHTB8SYqE8fIp93wKV92J69zTyoXTiqAOnWi504ZgrsHv9zDxHMFLyTIkvH8WjmsP/TP46TusqwvAx/aAJO+cnqV5Ny9+REkWM1jTCxZKeOmIltme3+aAFSpqdrAgx6hKQNB1bxtuBmI/9UmaeFkUrHSH75npbHQXU4FP8fSuuCdrwZ85wMrpFu5rR6uJ5Lus8JYtP1ta3WrwgxWe8+LDabFO9+cEve8crieQhNi+eojflhoZIDbSz1ANukIhW5GN+mkxZasw+/lISE3Mz4rXUktoEjcPvcxXIFvfUuBQTmC+mRCRx0rsaoUsrfCiG2mBp7eHpCLRC2GRDxNXveazWV+TRcofC0rbTmA+5gtyvCRVUYuClvq8JqQ7gghzpHnTWZbDJ2bp7knQOS79+w3yzPHaHfTKf9JzYyxtt9v1GM4B7M36PntgKaS8x2bMEDSot/2DiyXG9GthPa63LBiwx12r9db4DDzyIgsg85Wnz64y0mUKTu8M9KD17wuRfiuTQ292n3nxkgOMaUmraN8ErGjKytCM9Tu/lMd3QTwR2KrNzMS3qSVh/4M4ZmXM3s0N8R4vk/icVSSa98b3GHnO4jNtp0At5nYg5yxgMLYHhisYIGCQ3Uc0dp20gVpdom/XWJ5u45Ycop6LWrX01QkMC+Aq9uU2xYq1KdCUiX5833NgQ2skg5NGmc/L4iuuK2BSkmyY0iEBR1 ZJ6BsIGq wxO5wa77LRPaMRBGqjubZRSY2/bphhukROLrOcOwkdPG62MvYU14Dqfo1lCiZHn4y+M1GvY/fwgQJSo/e3ZskcDxHt2y6F46w3jNPLhCTOI7fwpnV9SHmZDJzSCwZ0ILqnW+D8/RRTwc4+EAd5awxRJ08OlXNG3hjBfC7hHbO0EjArpl+vYLenAOSphTdwZjEtWWo 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: Since the pinned pages have been put into inevictable list, folio_maybe_dma_pinned() calls in shrink_page_list() could be removed. Signed-off-by: Jinjiang Tu --- mm/vmscan.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 2fe4a11d63f4..590833c1fdbe 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1891,8 +1891,6 @@ static unsigned int shrink_folio_list(struct list_head *folio_list, if (!folio_test_swapcache(folio)) { if (!(sc->gfp_mask & __GFP_IO)) goto keep_locked; - if (folio_maybe_dma_pinned(folio)) - goto keep_locked; if (folio_test_large(folio)) { /* cannot split folio, skip it */ if (!can_split_folio(folio, NULL)) @@ -1959,16 +1957,6 @@ static unsigned int shrink_folio_list(struct list_head *folio_list, } } - /* - * Folio is unmapped now so it cannot be newly pinned anymore. - * No point in trying to reclaim folio if it is pinned. - * Furthermore we don't want to reclaim underlying fs metadata - * if the folio is pinned and thus potentially modified by the - * pinning process as that may upset the filesystem. - */ - if (folio_maybe_dma_pinned(folio)) - goto activate_locked; - mapping = folio_mapping(folio); if (folio_test_dirty(folio)) { /*