* [PATCH] lib/test_meminit: Allocate pages up to order MAX_ORDER
@ 2023-07-14 1:52 Andrew Donnellan
2023-07-14 12:09 ` Alexander Potapenko
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Donnellan @ 2023-07-14 1:52 UTC (permalink / raw)
To: akpm, glider, xkernel.wang, linux-kernel
test_pages() tests the page allocator by calling alloc_pages() with
different orders up to order 10.
However, different architectures and platforms support different maximum
contiguous allocation sizes. The default maximum allocation order
(MAX_ORDER) is 10, but architectures can use CONFIG_ARCH_FORCE_MAX_ORDER
to override this. On platforms where this is less than 10, test_meminit()
will blow up with a WARN(). This is expected, so let's not do that.
Replace the hardcoded "10" with the MAX_ORDER macro so that we test
allocations up to the expected platform limit.
Fixes: 5015a300a522 ("lib: introduce test_meminit module")
Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
---
lib/test_meminit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/test_meminit.c b/lib/test_meminit.c
index 60e1984c060f..0ae35223d773 100644
--- a/lib/test_meminit.c
+++ b/lib/test_meminit.c
@@ -93,7 +93,7 @@ static int __init test_pages(int *total_failures)
int failures = 0, num_tests = 0;
int i;
- for (i = 0; i < 10; i++)
+ for (i = 0; i <= MAX_ORDER; i++)
num_tests += do_alloc_pages_order(i, &failures);
REPORT_FAILURES_IN_FN();
--
2.41.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] lib/test_meminit: Allocate pages up to order MAX_ORDER
2023-07-14 1:52 [PATCH] lib/test_meminit: Allocate pages up to order MAX_ORDER Andrew Donnellan
@ 2023-07-14 12:09 ` Alexander Potapenko
0 siblings, 0 replies; 2+ messages in thread
From: Alexander Potapenko @ 2023-07-14 12:09 UTC (permalink / raw)
To: Andrew Donnellan; +Cc: akpm, xkernel.wang, linux-kernel
On Fri, Jul 14, 2023 at 3:53 AM Andrew Donnellan <ajd@linux.ibm.com> wrote:
>
> test_pages() tests the page allocator by calling alloc_pages() with
> different orders up to order 10.
>
> However, different architectures and platforms support different maximum
> contiguous allocation sizes. The default maximum allocation order
> (MAX_ORDER) is 10, but architectures can use CONFIG_ARCH_FORCE_MAX_ORDER
> to override this. On platforms where this is less than 10, test_meminit()
> will blow up with a WARN(). This is expected, so let's not do that.
>
> Replace the hardcoded "10" with the MAX_ORDER macro so that we test
> allocations up to the expected platform limit.
>
> Fixes: 5015a300a522 ("lib: introduce test_meminit module")
> Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
Reviewed-by: Alexander Potapenko <glider@google.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-14 12:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-14 1:52 [PATCH] lib/test_meminit: Allocate pages up to order MAX_ORDER Andrew Donnellan
2023-07-14 12:09 ` Alexander Potapenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox