All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] mm/compaction: no stuck in __reset_isolation_pfn()
@ 2019-02-06  3:47 Qian Cai
  2019-02-06  8:51 ` Mel Gorman
  0 siblings, 1 reply; 2+ messages in thread
From: Qian Cai @ 2019-02-06  3:47 UTC (permalink / raw)
  To: akpm; +Cc: mgorman, vbabka, linux-mm, linux-kernel, Qian Cai

The commit c68d77911c23 ("mm, compaction: be selective about what
pageblocks to clear skip hints") introduced an infinite loop if a pfn is
invalid, it will loop again without increasing page counters. It can be
reproduced by running LTP tests on an arm64 server.

 # oom01 (swapping)
 # hugemmap01
tst_test.c:1096: INFO: Timeout per run is 0h 05m 00s
mem.c:814: INFO: set nr_hugepages to 128
Test timeouted, sending SIGKILL!
Test timeouted, sending SIGKILL!
Test timeouted, sending SIGKILL!
Test timeouted, sending SIGKILL!
Test timeouted, sending SIGKILL!
Test timeouted, sending SIGKILL!
Test timeouted, sending SIGKILL!
Test timeouted, sending SIGKILL!
Test timeouted, sending SIGKILL!
Test timeouted, sending SIGKILL!
Test timeouted, sending SIGKILL!
Cannot kill test processes!
Congratulation, likely test hit a kernel bug.

Also, triggers soft lockups.

[  456.232228] watchdog: BUG: soft lockup - CPU#122 stuck for 22s! [kswapd0:1375]
[  456.273354] pstate: 80400009 (Nzcv daif +PAN -UAO)
[  456.278143] pc : pfn_valid+0x54/0xdc
[  456.281713] lr : __reset_isolation_pfn+0x3a8/0x584
[  456.369358] Call trace:
[  456.371798]  pfn_valid+0x54/0xdc
[  456.375019]  __reset_isolation_pfn+0x3a8/0x584
[  456.379455]  __reset_isolation_suitable+0x1bc/0x280
[  456.384325]  reset_isolation_suitable+0xb8/0xe0
[  456.388847]  kswapd+0xd08/0x1048
[  456.392067]  kthread+0x2f4/0x30c
[  456.395289]  ret_from_fork+0x10/0x18

Fixes: c68d77911c23 ("mm, compaction: be selective about what pageblocks to clear skip hints")
Signed-off-by: Qian Cai <cai@lca.pw>
---
 mm/compaction.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/mm/compaction.c b/mm/compaction.c
index 03804ab412f3..1cc871da3fda 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -282,17 +282,16 @@ __reset_isolation_pfn(struct zone *zone, unsigned long pfn, bool check_source,
 	end_page = pfn_to_page(pfn);
 
 	do {
-		if (!pfn_valid_within(pfn))
-			continue;
-
-		if (check_source && PageLRU(page)) {
-			clear_pageblock_skip(page);
-			return true;
-		}
+		if (pfn_valid_within(pfn)) {
+			if (check_source && PageLRU(page)) {
+				clear_pageblock_skip(page);
+				return true;
+			}
 
-		if (check_target && PageBuddy(page)) {
-			clear_pageblock_skip(page);
-			return true;
+			if (check_target && PageBuddy(page)) {
+				clear_pageblock_skip(page);
+				return true;
+			}
 		}
 
 		page += (1 << PAGE_ALLOC_COSTLY_ORDER);
-- 
2.17.2 (Apple Git-113)


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

* Re: [PATCH -next] mm/compaction: no stuck in __reset_isolation_pfn()
  2019-02-06  3:47 [PATCH -next] mm/compaction: no stuck in __reset_isolation_pfn() Qian Cai
@ 2019-02-06  8:51 ` Mel Gorman
  0 siblings, 0 replies; 2+ messages in thread
From: Mel Gorman @ 2019-02-06  8:51 UTC (permalink / raw)
  To: Qian Cai; +Cc: akpm, vbabka, linux-mm, linux-kernel

On Tue, Feb 05, 2019 at 10:47:32PM -0500, Qian Cai wrote:
> The commit c68d77911c23 ("mm, compaction: be selective about what
> pageblocks to clear skip hints") introduced an infinite loop if a pfn is
> invalid, it will loop again without increasing page counters. It can be
> reproduced by running LTP tests on an arm64 server.
> 

That was careless of me but the patch looks
correct. Andrew, this is a fix to the mmotm patch
mm-compaction-be-selective-about-what-pageblocks-to-clear-skip-hints.patch

Acked-by: Mel Gorman <mgorman@techsingularity.net>

Thanks Qian!

-- 
Mel Gorman
SUSE Labs

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

end of thread, other threads:[~2019-02-06  8:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-06  3:47 [PATCH -next] mm/compaction: no stuck in __reset_isolation_pfn() Qian Cai
2019-02-06  8:51 ` Mel Gorman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.