aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYunfeng Ye <[email protected]>2019-11-30 17:57:42 -0800
committerLinus Torvalds <[email protected]>2019-12-01 12:59:09 -0800
commitd3cd257ce15bad10a86f5064433c9dda4d019697 (patch)
tree3eb5e51a7241e8ee7da6b79e26aabceb6bbc38df
parent5d42ab293f5181609ea18f1f2ab85cd4cfc8efb2 (diff)
mm/madvise.c: replace with page_size() in madvise_inject_error()
page_size() is supported after the commit a50b854e073c ("mm: introduce page_size()"). Use page_size() in madvise_inject_error() for readability. [[email protected]: use ulong for `size', per David] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Yunfeng Ye <[email protected]> Reviewed-by: Andrew Morton <[email protected]> Acked-by: David Rientjes <[email protected]> Cc: Jason Gunthorpe <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Minchan Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Jan Kara <[email protected]> Cc: Mike Rapoport <[email protected]> Cc: Hu Shiyuan <[email protected]> Cc: Feilong Lin <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/madvise.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/madvise.c b/mm/madvise.c
index 63e130800570..e808dbeb27f3 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -864,13 +864,13 @@ static int madvise_inject_error(int behavior,
{
struct page *page;
struct zone *zone;
- unsigned int order;
+ unsigned long size;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
- for (; start < end; start += PAGE_SIZE << order) {
+ for (; start < end; start += size) {
unsigned long pfn;
int ret;
@@ -882,9 +882,9 @@ static int madvise_inject_error(int behavior,
/*
* When soft offlining hugepages, after migrating the page
* we dissolve it, therefore in the second loop "page" will
- * no longer be a compound page, and order will be 0.
+ * no longer be a compound page.
*/
- order = compound_order(compound_head(page));
+ size = page_size(compound_head(page));
if (PageHWPoison(page)) {
put_page(page);