]> git.baikalelectronics.ru Git - kernel.git/commit
mm/vmscan: fix NR_ISOLATED_FILE corruption on 64-bit
authorNicholas Piggin <npiggin@gmail.com>
Sat, 14 Nov 2020 06:51:46 +0000 (22:51 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 14 Nov 2020 19:26:03 +0000 (11:26 -0800)
commitcf54f96edd2e0c95e30378ff41ed231062e606dc
tree337d0326c6a5d1a71ef72a7ef8782da3df36d22f
parentfcc6990c63c4ab4275de4a61da8b9d27594aeaef
mm/vmscan: fix NR_ISOLATED_FILE corruption on 64-bit

Previously the negated unsigned long would be cast back to signed long
which would have the correct negative value.  After commit 1a3fa354f685
("mm/vmscan.c: change prototype for shrink_page_list"), the large
unsigned int converts to a large positive signed long.

Symptoms include CMA allocations hanging forever holding the cma_mutex
due to alloc_contig_range->...->isolate_migratepages_block waiting
forever in "while (unlikely(too_many_isolated(pgdat)))".

[akpm@linux-foundation.org: fix -stat.nr_lazyfree_fail as well, per Michal]

Fixes: 1a3fa354f685 ("mm/vmscan.c: change prototype for shrink_page_list")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Vaneet Narang <v.narang@samsung.com>
Cc: Maninder Singh <maninder1.s@samsung.com>
Cc: Amit Sahrawat <a.sahrawat@samsung.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: <stable@vger.kernel.org>
Link: https://lkml.kernel.org/r/20201029032320.1448441-1-npiggin@gmail.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/vmscan.c