diff mbox series

[RFC,2/2] mm/gup: remove folio_maybe_dma_pinned() calls in shrink_page_list()

Message ID 20230826092240.713105-3-tujinjiang@huawei.com (mailing list archive)
State New
Headers show
Series mm/gup: move pinned pages to unevictable list to avoid meaningless scan | expand

Commit Message

Jinjiang Tu Aug. 26, 2023, 9:22 a.m. UTC
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 <tujinjiang@huawei.com>
---
 mm/vmscan.c | 12 ------------
 1 file changed, 12 deletions(-)
diff mbox series

Patch

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)) {
 			/*