linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jinjiang Tu <tujinjiang@huawei.com>
To: <linux-mm@kvack.org>, <akpm@linux-foundation.org>,
	<wangkefeng.wang@huawei.com>
Cc: <tujinjiang@huawei.com>
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	[thread overview]
Message-ID: <20230826092240.713105-3-tujinjiang@huawei.com> (raw)
In-Reply-To: <20230826092240.713105-1-tujinjiang@huawei.com>

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



      parent reply	other threads:[~2023-08-26  8:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-26  9:22 [RFC PATCH 0/2] mm/gup: move pinned pages to unevictable list to avoid meaningless scan Jinjiang Tu
2023-08-26  9:22 ` [RFC PATCH 1/2] " Jinjiang Tu
2023-08-26  9:22 ` Jinjiang Tu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230826092240.713105-3-tujinjiang@huawei.com \
    --to=tujinjiang@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=wangkefeng.wang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox