From d4e7c906c061fa054fb5efc93a17f816196a5def Mon Sep 17 00:00:00 2001 From: LI Qing Date: Fri, 18 Dec 2020 11:48:16 +0800 Subject: [PATCH] Fix the sched test when available cpu is less than online cpu --- test/sched/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/sched/main.c b/test/sched/main.c index 6b7f1df4..ca8b822a 100644 --- a/test/sched/main.c +++ b/test/sched/main.c @@ -54,8 +54,8 @@ static int test_sched_getaffinity_with_self_pid() { if (CPU_COUNT(&mask) <= 0) { THROW_ERROR("failed to get cpuset mask"); } - if (sysconf(_SC_NPROCESSORS_ONLN) != CPU_COUNT(&mask)) { - THROW_ERROR("cpuset num wrong"); + if (sysconf(_SC_NPROCESSORS_ONLN) < CPU_COUNT(&mask)) { + THROW_ERROR("cpuset num must be less or equal to _SC_NPROCESSORS_ONLN"); } return 0; } @@ -166,7 +166,7 @@ static int test_sched_xetaffinity_children_inheritance() { return 0; } -#define CPU_SET_SIZE_LIMIT (1024) +#define CPU_SET_SIZE_LIMIT (128) static int test_sched_getaffinity_via_explicit_syscall() { unsigned char buf[CPU_SET_SIZE_LIMIT] = { 0 };