move_pages12: Ignore ENOMEM from madvise(MADV_SOFT_OFFLINE)
PATCH 1/2 move_pages12: Ignore ENOMEM from madvise(MADV_SOFT_OFFLINE)
The test dissolves hugepages which results in soft-offline madvise() call returning ENOMEM after a few iterations. This is expected behavior. However, trying to preallocate more hugepages to prevent the error will break the ability to reproduce the SIGBUS bug. Simply ignoring the ENOMEM error is good enough.
--- testcases/kernel/syscalls/move_pages/move_pages12.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/syscalls/move_pages/move_pages12.c +1 -1
@@ -100,7 +100,7 @@ static void *addr;static int do_soft_offline (int tpgs) {if (madvise (addr, tpgs * hpsz,MADV_SOFT_OFFLINE ) ==-1 ) { -if (errno !=EINVAL && errno !=EBUSY ) +if (errno !=EINVAL && errno !=EBUSY && errno !=ENOMEM )tst_res (TFAIL |TERRNO ,"madvise failed" );return errno; }
Signature · 5 lines
2.47.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH 2/2 move_pages12: Increase loop count to 10,000
Since the test doesn't print hundreds of ENOMEM error messages anymore after the previous change, it now runs too fast to reproduce the SIGBUS bug. Increase loop count to make the bug reproducible again.
--- testcases/kernel/syscalls/move_pages/move_pages12.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/syscalls/move_pages/move_pages12.c +1 -1
@@ -74,7 +74,7 @@#ifdef HAVE_NUMA_V2 -#define LOOPS 1000 +#define LOOPS 10000#define PATH_MEMINFO "/proc/meminfo"#define PATH_NR_HUGEPAGES "/proc/sys/vm/nr_hugepages"#define PATH_HUGEPAGES "/sys/kernel/mm/hugepages/"
Signature · 5 lines
2.47.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Re: [LTP] [PATCH 2/2] move_pages12: Increase loop count to 10,000
Quoted 6 lines · Martin Doucha
Since the test doesn't print hundreds of ENOMEM error messages anymore after the previous change, it now runs too fast to reproduce the SIGBUS bug. Increase loop count to make the bug reproducible again.
Signed-off-by Martin Doucha <[email protected]>
---
Quoted 25 lines
testcases/kernel/syscalls/move_pages/move_pages12.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)testcases/kernel/syscalls/move_pages/move_pages12.c +1
-2@@ -74,7 +74,7 @@#ifdef HAVE_NUMA_V2 -#define LOOPS 1000 +#define LOOPS 10000#define PATH_MEMINFO "/proc/meminfo"#define PATH_NR_HUGEPAGES "/proc/sys/vm/nr_hugepages"#define PATH_HUGEPAGES "/sys/kernel/mm/hugepages/" --2.47.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
Signature · 5 lines
Regards, Li Wang -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Martin,
I had ever added a compressed memory step to dis fragmental before doing hugepage allocations (in commit e97f41970582 ), but that didn't seem to solve the problem ideally.
Anyway, this patch looks good.
Quoted 34 lines · Martin Doucha
The test dissolves hugepages which results in soft-offline
madvise()call returning ENOMEM after a few iterations. This is expected behavior. However,
trying to preallocate more hugepages to prevent the error will break the ability to reproduce the SIGBUS bug. Simply ignoring the ENOMEM error is good enough.Signed-off-by Martin Doucha <[email protected]>--- testcases/kernel/syscalls/move_pages/move_pages12.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)testcases/kernel/syscalls/move_pages/move_pages12.c +1
-2@@ -100,7 +100,7 @@ static void *addr;static int do_soft_offline (int tpgs) {if (madvise (addr, tpgs * hpsz,MADV_SOFT_OFFLINE ) ==-1 ) { -if (errno !=EINVAL && errno !=EBUSY ) +if (errno !=EINVAL && errno !=EBUSY && errno !=ENOMEM )tst_res (TFAIL |TERRNO ,"madvise failed" );return errno; } --2.47.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
Signature · 5 lines
Regards, Li Wang -- Mailing list info: https://lists.linux.it/listinfo/ltp
Patchset merged, thanks!
Quoted 51 lines · Li Wang
Hi Martin,
I had ever added a compressed memory step to dis fragmental before doing hugepage allocations (in commit
e97f41970582), but that didn't seem to solve the problem ideally.Anyway, this patch looks good.
Reviewed-by Li Wang <[email protected]>Quoted 30 lines · Martin Doucha
The test dissolves hugepages which results in soft-offline
madvise()call returning ENOMEM after a few iterations. This is expected behavior. However,
trying to preallocate more hugepages to prevent the error will break the ability to reproduce the SIGBUS bug. Simply ignoring the ENOMEM error is good enough.Signed-off-by Martin Doucha <[email protected]>--- testcases/kernel/syscalls/move_pages/move_pages12.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)testcases/kernel/syscalls/move_pages/move_pages12.c +1
-2@@ -100,7 +100,7 @@ static void *addr;static int do_soft_offline (int tpgs) {if (madvise (addr, tpgs * hpsz,MADV_SOFT_OFFLINE ) ==-1 ) { -if (errno !=EINVAL && errno !=EBUSY ) +if (errno !=EINVAL && errno !=EBUSY && errno !=ENOMEM )tst_res (TFAIL |TERRNO ,"madvise failed" );return errno; } --2.47.0
Quoted 4 lines
--
Mailing list info: https://lists.linux.it/listinfo/ltp--
Regards,
Li Wang
Signature · 5 lines
Regards, Li Wang -- Mailing list info: https://lists.linux.it/listinfo/ltp