Skip to contentSkip to conversation

mm/page_isolation: use micro to judge the alignment

PATCH Naoya Horiguchi 1 participant 1 message Jan 4, 2016 1 message not in the archive Memory management

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20160104134154.40c28f94@debian

Naoya Horiguchi

author Reviewed-by
#1 lore raw
Quoted 4 lines · Wang Xiaoqiang

Hi, Naoya,

This patch simply use micro IS_ALIGNED() to judge the alignment, instead of directly judging.

Hi Xiaoqiang,

Can you apply the same cleanup to undo_isolate_page_range(), too? But anyway, this looks a good cleanup to me.

Thanks,
Naoya Horiguchi

Quoted 26 lines
---
 mm/page_isolation.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/page_isolation.c +2 -2
index 4568fd5..9248929 100644
@@ -162,8 +162,8 @@ int start_isolate_page_range(unsigned long
 start_pfn, unsigned long end_pfn, unsigned long undo_pfn;
 	struct page *page;
 
-	BUG_ON((start_pfn) & (pageblock_nr_pages - 1));
-	BUG_ON((end_pfn) & (pageblock_nr_pages - 1));
+	BUG_ON(!IS_ALIGNED(start_pfn, pageblock_nr_pages));
+	BUG_ON(!IS_ALIGNED(end_pfn, pageblock_nr_pages));
 
 	for (pfn = start_pfn;
 	     pfn < end_pfn;
Signature · 4 lines
2.1.4

thanks
Wang Xiaoqiang

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>