Skip to content

Commit 34a1ca0

Browse files
author
Artem Belov
committed
Use correct page size \n not default
1 parent ece38b3 commit 34a1ca0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/vppinfra/pmalloc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ pmalloc_map_pages (clib_pmalloc_main_t * pm, clib_pmalloc_arena_t * a,
264264
int old_mpol = -1;
265265
long unsigned int mask[16] = { 0 };
266266
long unsigned int old_mask[16] = { 0 };
267+
uword page_size = 1 << a->log2_subpage_sz;
267268
uword size = (uword) n_pages << pm->def_log2_page_sz;
268269

269270
clib_error_free (pm->error);
@@ -341,7 +342,7 @@ pmalloc_map_pages (clib_pmalloc_main_t * pm, clib_pmalloc_arena_t * a,
341342
for (int i = 0; i < n_pages; i++)
342343
{
343344
unsigned char flag;
344-
mincore(va + i * clib_mem_get_page_size(), 1, &flag);
345+
mincore(va + i * page_size, 1, &flag);
345346
// flag is 1 if the page was successfully allocated and in memory
346347
if (!flag)
347348
{

0 commit comments

Comments
 (0)