[LTP] [PATCH 05/18] hugeshmctl02: Fix allocation size for odd number of hugepages

Cyril Hrubis chrubis@suse.cz
Tue Oct 31 12:05:31 CET 2017


Hi!
> The test tries to allocate 2 * (half the number of available hugepages).
> If we have odd number hugepages, the calculated allocation size is not
> page-aligned and allocation fails.
> 
> e.g, (use -s option to trigger it manually)
> 
> $ hugeshmctl02 -s 7 -i 5
> hugeshmctl02    0  TINFO  :  set nr_hugepages to 7
> hugeshmctl02    1  TBROK  :  hugeshmctl02.c:153: shmget #2: errno=ENOMEM(12): Cannot allocate memory
> hugeshmctl02    2  TBROK  :  hugeshmctl02.c:153: Remaining cases broken
> hugeshmctl02    0  TINFO  :  set nr_hugepages to 0
> 
> Align the size to hugepage_size.

This one is obviously OK.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list