If we were ever to do an allocation with kmalloc(), we could
get non-page-aligned memory.
We haven't seen any problem yet, but we are trying to be ready for
this in advance. The arguments from https://lwn.net/Articles/787740/
also look strong.
Let's add an assertion to illuminate this dangerous behaviour.
EX-bug-id: EX-8245
Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Signed-off-by: Artem Blagodarenko <ablagodarenko@ddn.com>
Change-Id: Id20898065b516d363d9dc280e71be1b5cfb6f4a7
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57844
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Sergey Cheremencev <scherementsev@ddn.com>
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
else {
OBD_ALLOC_LARGE(ptr_pages[i][j],
object_size(page_pool));
+ /*
+ * It is possible that at some moment kmalloc
+ * will start to return non-page aligned memory,
+ * so leave this assort for quicker problem
+ * detection
+ */
+ LASSERTF(IS_ALIGNED((unsigned long)
+ (ptr_pages[i][j]),
+ PAGE_SIZE),
+ "Page %p (order %i) is not aligned to PAGE_SIZE",
+ ptr_pages[i][j], page_pool->opp_order);
+
}
if (ptr_pages[i][j] == NULL)
goto out_ptr_pages;