linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/gup: don't check page lru flag before draining it
@ 2024-06-04 10:48 yangge1116
  2024-06-04 13:47 ` David Hildenbrand
  0 siblings, 1 reply; 25+ messages in thread
From: yangge1116 @ 2024-06-04 10:48 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, baolin.wang, liuzixing, yangge

From: yangge <yangge1116@126.com>

If a page is added in pagevec, its ref count increases one, remove
the page from pagevec decreases one. Page migration requires the
page is not referenced by others except page mapping. Before
migrating a page, we should try to drain the page from pagevec in
case the page is in it, however, folio_test_lru() is not sufficient
to tell whether the page is in pagevec or not, if the page is in
pagevec, the migration will fail.

Remove the condition and drain lru once to ensure the page is not
referenced by pagevec.

Signed-off-by: yangge <yangge1116@126.com>
---
 mm/gup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/gup.c b/mm/gup.c
index e17466f..4fa739c 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -2460,7 +2460,7 @@ static unsigned long collect_longterm_unpinnable_folios(
 			continue;
 		}
 
-		if (!folio_test_lru(folio) && drain_allow) {
+		if (drain_allow) {
 			lru_add_drain_all();
 			drain_allow = false;
 		}
-- 
2.7.4



^ permalink raw reply	[flat|nested] 25+ messages in thread
* [PATCH] mm/gup: don't check page lru flag before draining it
@ 2024-06-04  8:09 yangge1116
  2024-06-04  8:56 ` Baolin Wang
  0 siblings, 1 reply; 25+ messages in thread
From: yangge1116 @ 2024-06-04  8:09 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, baolin.wang, liuzixing, yangge

From: yangge <yangge1116@126.com>

If a page is added in pagevec, its ref count increases one, remove
the page from pagevec decreases one. Page migration requires the
page is not referrened by others except page mapping. Before
migrating a page, we should try to drain the page from pagevec in
case the page is in it, however, folio_test_lru() is not sufficient
to tell whether the page is in pagevec or not, if the page is in
pagevec, the migration will fail.

Remove the condition and drain lru once to ensure the page is not
referrenced by pagevec.

Signed-off-by: yangge <yangge1116@126.com>
---
 mm/gup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/gup.c b/mm/gup.c
index ca0f5ce..890dcbc 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -2411,7 +2411,7 @@ static unsigned long collect_longterm_unpinnable_pages(
 			continue;
 		}
 
-		if (!folio_test_lru(folio) && drain_allow) {
+		if (drain_allow) {
 			lru_add_drain_all();
 			drain_allow = false;
 		}
-- 
2.7.4



^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2024-06-17 11:23 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-04 10:48 [PATCH] mm/gup: don't check page lru flag before draining it yangge1116
2024-06-04 13:47 ` David Hildenbrand
2024-06-05  1:18   ` yangge1116
2024-06-05  9:41     ` David Hildenbrand
2024-06-05  9:53       ` David Hildenbrand
2024-06-05 11:37         ` Baolin Wang
2024-06-05 11:41           ` David Hildenbrand
2024-06-05 12:20             ` David Hildenbrand
2024-06-06  1:57               ` Baolin Wang
2024-06-06  7:56                 ` David Hildenbrand
2024-06-08  4:38                   ` yangge1116
2024-06-08 15:15                     ` Matthew Wilcox
2024-06-08 16:03                       ` David Hildenbrand
2024-06-11 11:20                         ` yangge1116
2024-06-12  7:32                           ` David Hildenbrand
2024-06-15 11:44                             ` yangge1116
2024-06-17  9:50                             ` yangge1116
2024-06-17  9:52                               ` David Hildenbrand
2024-06-17 11:22                                 ` yangge1116
2024-06-06  1:35         ` yangge1116
2024-06-06  7:39           ` David Hildenbrand
2024-06-06  8:50             ` yangge1116
  -- strict thread matches above, loose matches on Subject: below --
2024-06-04  8:09 yangge1116
2024-06-04  8:56 ` Baolin Wang
2024-06-04  9:18   ` yangge1116

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox