Skip to content

Commit

Permalink
tools/vm/page-types.c: fix "kpagecount returned fewer pages than expe…
Browse files Browse the repository at this point in the history
…cted" failures

Because kpagecount_read() fakes success if map counts are not being
collected, clamp the page count passed to it by walk_pfn() to the pages
value returned by the preceding call to kpageflags_read().

Link: http://lkml.kernel.org/r/1543962269-26116-1-git-send-email-anthony.yznaga@oracle.com
Fixes: 7f1d23e ("tools/vm/page-types.c: include shared map counts")
Signed-off-by: Anthony Yznaga <anthony.yznaga@oracle.com>
Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Anthony Yznaga authored and Linus Torvalds committed Dec 28, 2018
1 parent bbe5d99 commit b6fb87b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/vm/page-types.c
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ static void walk_pfn(unsigned long voffset,
if (kpagecgroup_read(cgi, index, pages) != pages)
fatal("kpagecgroup returned fewer pages than expected");

if (kpagecount_read(cnt, index, batch) != pages)
if (kpagecount_read(cnt, index, pages) != pages)
fatal("kpagecount returned fewer pages than expected");

for (i = 0; i < pages; i++)
Expand Down

0 comments on commit b6fb87b

Please sign in to comment.