/kernel/liteos_a/testsuites/unittest/process/basic/process/smp/ |
H A D | process_test_smp_008.cpp | 36 cpu_set_t cpuset; in PthreadTest01() local 38 CPU_ZERO(&cpuset); in PthreadTest01() 39 CPU_SET(0, &cpuset); /* cpu0 */ in PthreadTest01() 40 ret = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); in PthreadTest01() 43 CPU_ZERO(&cpuset); in PthreadTest01() 44 ret = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); in PthreadTest01() 46 ret = (CPU_ISSET(0, &cpuset)) > 0 ? 1 : 0; in PthreadTest01() 48 ret = (CPU_ISSET(1, &cpuset)) > 0 ? 1 : 0; in PthreadTest01() 51 CPU_ZERO(&cpuset); in PthreadTest01() 52 CPU_SET(0, &cpuset); /* cpu in PthreadTest01() 86 cpu_set_t cpuset; Testcase() local [all...] |
H A D | process_test_smp_006.cpp | 36 cpu_set_t cpuset; in PthreadTest01() local 38 CPU_ZERO(&cpuset); in PthreadTest01() 39 CPU_SET(1, &cpuset); /* cpu1 */ in PthreadTest01() 40 ret = sched_setaffinity(0, sizeof(cpu_set_t), &cpuset); in PthreadTest01() 43 CPU_ZERO(&cpuset); in PthreadTest01() 44 ret = sched_getaffinity(0, sizeof(cpu_set_t), &cpuset); in PthreadTest01() 46 ret = (CPU_ISSET(0, &cpuset)) > 0 ? 1 : 0; in PthreadTest01() 48 ret = (CPU_ISSET(1, &cpuset)) > 0 ? 1 : 0; in PthreadTest01() 63 cpu_set_t cpuset; in Testcase() local 66 CPU_ZERO(&cpuset); in Testcase() [all...] |
H A D | process_test_smp_003.cpp | 42 cpu_set_t cpuset; in Testcase() local 44 CPU_ZERO(&cpuset); in Testcase() 45 CPU_SET(0, &cpuset); in Testcase() 46 ret = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); in Testcase() 48 ret = sched_getaffinity(0, sizeof(cpu_set_t), &cpuset); in Testcase() 50 ret = (CPU_ISSET(0, &cpuset) > 0) ? 1 : 0; in Testcase() 52 ret = (CPU_ISSET(1, &cpuset) > 0) ? 1 : 0; in Testcase() 55 CPU_ZERO(&cpuset); in Testcase() 56 CPU_SET(1, &cpuset); in Testcase() 57 ret = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); in Testcase() [all...] |
H A D | process_test_smp_002.cpp | 36 cpu_set_t cpuset; in PthreadTest01() local 38 CPU_ZERO(&cpuset); in PthreadTest01() 39 CPU_SET(0, &cpuset); /* cpu0 */ in PthreadTest01() 40 ret = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); in PthreadTest01() 43 CPU_ZERO(&cpuset); in PthreadTest01() 44 ret = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); in PthreadTest01() 46 ret = (CPU_ISSET(0, &cpuset) > 0) ? 1 : 0; in PthreadTest01() 48 ret = (CPU_ISSET(1, &cpuset) > 0) ? 1 : 0; in PthreadTest01() 51 CPU_ZERO(&cpuset); in PthreadTest01() 52 ret = sched_getaffinity(getpid(), sizeof(cpu_set_t), &cpuset); in PthreadTest01() 72 cpu_set_t cpuset; Testcase() local [all...] |
H A D | process_test_smp_007.cpp | 36 cpu_set_t cpuset; in PthreadTest01() local 40 CPU_ZERO(&cpuset); in PthreadTest01() 41 ret = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); in PthreadTest01() 43 ret = (CPU_ISSET(0, &cpuset)) > 0 ? 1 : 0; in PthreadTest01() 45 ret = (CPU_ISSET(1, &cpuset)) > 0 ? 1 : 0; in PthreadTest01() 60 cpu_set_t cpuset; in Testcase() local 63 CPU_ZERO(&cpuset); in Testcase() 64 CPU_SET(0, &cpuset); /* cpu0 */ in Testcase() 65 ret = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); in Testcase() 68 CPU_ZERO(&cpuset); in Testcase() [all...] |
H A D | process_test_smp_005.cpp | 36 cpu_set_t cpuset; in PthreadTest01() local 38 CPU_ZERO(&cpuset); in PthreadTest01() 39 CPU_SET(1, &cpuset); /* cpu1 */ in PthreadTest01() 40 ret = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); in PthreadTest01() 43 CPU_ZERO(&cpuset); in PthreadTest01() 44 ret = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); in PthreadTest01() 46 ret = (CPU_ISSET(0, &cpuset)) > 0 ? 1 : 0; in PthreadTest01() 48 ret = (CPU_ISSET(1, &cpuset)) > 0 ? 1 : 0; in PthreadTest01() 63 cpu_set_t cpuset; in Testcase() local 66 CPU_ZERO(&cpuset); in Testcase() [all...] |
H A D | process_test_smp_001.cpp | 42 cpu_set_t cpuset; in Testcase() local 44 CPU_ZERO(&cpuset); in Testcase() 45 CPU_SET(1, &cpuset); /* cpu1 */ in Testcase() 46 ret = sched_setaffinity(getpid(), sizeof(cpu_set_t), &cpuset); in Testcase() 48 CPU_ZERO(&cpuset); in Testcase() 49 ret = sched_getaffinity(getpid(), sizeof(cpu_set_t), &cpuset); in Testcase() 51 ret = (CPU_ISSET(0, &cpuset) > 0) ? 1 : 0; in Testcase() 53 ret = (CPU_ISSET(1, &cpuset) > 0) ? 1 : 0; in Testcase()
|
H A D | process_test_smp_004.cpp | 36 cpu_set_t cpuset; in Testcase() local 37 ret = pthread_getaffinity_np(pthread_self(), 0, &cpuset); in Testcase() 39 ret = pthread_setaffinity_np(pthread_self(), 0, &cpuset); in Testcase() 41 ret = sched_setaffinity(getpid(), 0, &cpuset); in Testcase() 43 ret = sched_getaffinity(getpid(), 0, &cpuset); in Testcase()
|
/kernel/linux/build/test/moduletest/runtest/bin/cpusetdecouple_cpuhotplug_t/testcases/bin/ |
H A D | cpusetdecouple_cpuhotplug02.sh | 27 if [ ! -d "/dev/cpuset" ]; then 31 if mountpoint -q /dev/cpuset; then 32 tst_res TINFO "mountpoint -q /dev/cpuset" 34 mount -t cpuset none /dev/cupset 35 tst_res TINFO "mount -t cpuset none /dev/cupset" 44 mkdir /dev/cpuset/hotplug02 45 echo "1" > /dev/cpuset/hotplug02/cpuset.cpus 46 cat /dev/cpuset/hotplug02/cpuset [all...] |
H A D | cpusetdecouple_cpuhotplug01.sh | 27 if [ ! -d "/dev/cpuset" ]; then 31 if mountpoint -q /dev/cpuset; then 32 tst_res TINFO "mountpoint -q /dev/cpuset" 34 mount -t cpuset none /dev/cupset 35 tst_res TINFO "mount -t cpuset none /dev/cupset" 44 mkdir /dev/cpuset/hotplug01 45 echo "0-3" > /dev/cpuset/hotplug01/cpuset.cpus 46 cat /dev/cpuset/hotplug01/cpuset [all...] |
H A D | cpusetdecouple_cpuhotplug04.sh | 27 if [ ! -d "/dev/cpuset" ]; then 31 if mountpoint -q /dev/cpuset; then 32 tst_res TINFO "mountpoint -q /dev/cpuset" 34 mount -t cpuset none /dev/cupset 35 tst_res TINFO "mount -t cpuset none /dev/cupset" 44 mkdir /dev/cpuset/hotplug04 45 echo "0-3" > /dev/cpuset/hotplug04/cpuset.cpus 46 cat /dev/cpuset/hotplug04/cpuset [all...] |
H A D | cpusetdecouple_cpuhotplug03.sh | 27 if [ ! -d "/dev/cpuset" ]; then 31 if mountpoint -q /dev/cpuset; then 32 tst_res TINFO "mountpoint -q /dev/cpuset" 34 mount -t cpuset none /dev/cupset 35 tst_res TINFO "mount -t cpuset none /dev/cupset" 44 mkdir /dev/cpuset/hotplug03 48 echo "0-3" > /dev/cpuset/hotplug03/cpuset.cpus 49 cat /dev/cpuset/hotplug03/cpuset [all...] |
/kernel/liteos_a/testsuites/unittest/process/basic/process/smoke/ |
H A D | process_test_048.cpp | 48 cpu_set_t cpuset; in Testcase() local 50 CPU_ZERO(&cpuset); in Testcase() 51 CPU_SET(1, &cpuset); /* cpu1 unsupported operation */ in Testcase() 52 ret = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); in Testcase() 54 CPU_ZERO(&cpuset); in Testcase() 56 CPU_ZERO(&cpuset); in Testcase() 57 CPU_SET(0, &cpuset); /* cpu0 */ in Testcase() 58 ret = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); in Testcase() 60 CPU_ZERO(&cpuset); in Testcase() 62 ret = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); in Testcase() [all...] |
H A D | process_test_046.cpp | 48 cpu_set_t cpuset; in Testcase() local 50 CPU_ZERO(&cpuset); in Testcase() 51 CPU_SET(1, &cpuset); /* cpu1 unsupported operation */ in Testcase() 52 ret = sched_setaffinity(getpid(), sizeof(cpu_set_t), &cpuset); in Testcase() 55 CPU_ZERO(&cpuset); in Testcase() 56 CPU_SET(0, &cpuset); /* cpu0 */ in Testcase() 57 ret = sched_setaffinity(getpid(), sizeof(cpu_set_t), &cpuset); in Testcase() 59 CPU_ZERO(&cpuset); in Testcase() 61 ret = sched_getaffinity(getpid(), sizeof(cpu_set_t), &cpuset); in Testcase() 63 ret = (CPU_ISSET(0, &cpuset) > in Testcase() [all...] |
H A D | process_test_045.cpp | 37 cpu_set_t cpuset; in Testcase() local 38 CPU_ZERO(&cpuset); in Testcase() 40 ret = pthread_getaffinity_np(pthread_self(), 0, &cpuset); in Testcase() 43 ret = pthread_setaffinity_np(pthread_self(), 0, &cpuset); in Testcase() 46 ret = sched_setaffinity(getpid(), 0, &cpuset); in Testcase() 50 ret = sched_getaffinity(getpid(), 0, &cpuset); in Testcase() 54 ret = sched_setaffinity(-15, sizeof(cpu_set_t), &cpuset); // -15, pid num in Testcase() 58 ret = sched_setaffinity(1, sizeof(cpu_set_t), &cpuset); // init process, no permission in Testcase() 62 ret = sched_setaffinity(128, sizeof(cpu_set_t), &cpuset); // 128, pid num in Testcase() 66 ret = sched_getaffinity(128, sizeof(cpu_set_t), &cpuset); // 12 in Testcase() [all...] |
/kernel/linux/linux-5.10/kernel/cgroup/ |
H A D | cpuset.c | 2 * kernel/cpuset.c 28 #include <linux/cpuset.h> 83 struct cpuset { struct 92 * cpuset.cpus and cpuset.mems, and won't be limited by the 96 * in the cpuset. They may be changed if the configured masks are 131 * - A new cpuset's old_mems_allowed is initialized when some 134 * cpuset.mems_allowed and have tasks' nodemask updated, and 142 * Tasks are being attached to this cpuset. Used to prevent 168 * number of SCHED_DEADLINE tasks attached to this cpuset, s 1190 update_parent_subparts_cpumask(struct cpuset *cpuset, int cmd, struct cpumask *newmask, struct tmpmasks *tmp) update_parent_subparts_cpumask() argument [all...] |
/kernel/linux/linux-6.6/kernel/cgroup/ |
H A D | cpuset.c | 2 * kernel/cpuset.c 27 #include <linux/cpuset.h> 51 * There could be abnormal cpuset configurations for cpu or memory 81 [PERR_INVCPUS] = "Invalid cpu list in cpuset.cpus", 84 [PERR_NOTEXCL] = "Cpu list in cpuset.cpus not exclusive", 87 [PERR_CPUSEMPTY] = "cpuset.cpus is empty", 90 struct cpuset { struct 99 * cpuset.cpus and cpuset.mems, and won't be limited by the 103 * in the cpuset [all...] |
/kernel/liteos_a/testsuites/unittest/container/full/ |
H A D | It_pid_container_008.cpp | 36 cpu_set_t cpuset; in ChildFun() local 45 CPU_ZERO(&cpuset); in ChildFun() 46 CPU_SET(1, &cpuset); in ChildFun() 47 ret = sched_setaffinity(getpid(), sizeof(cpu_set_t), &cpuset); in ChildFun() 52 CPU_ZERO(&cpuset); in ChildFun() 53 ret = sched_getaffinity(getpid(), sizeof(cpu_set_t), &cpuset); in ChildFun() 57 ret = (CPU_ISSET(0, &cpuset) > 0) ? 1 : 0; in ChildFun() 61 ret = (CPU_ISSET(1, &cpuset) > 0) ? 1 : 0; in ChildFun()
|
/kernel/liteos_a/compat/posix/src/ |
H A D | pthread_attr.c | 53 attr->cpuset.__bits[0] = 0; in pthread_attr_init() 240 int pthread_attr_setaffinity_np(pthread_attr_t* attr, size_t cpusetsize, const cpu_set_t* cpuset) in pthread_attr_setaffinity_np() argument 247 if ((cpuset == NULL) || (cpusetsize == 0)) { in pthread_attr_setaffinity_np() 248 attr->cpuset.__bits[0] = 0; in pthread_attr_setaffinity_np() 252 if ((cpusetsize != sizeof(cpu_set_t)) || (cpuset->__bits[0] > LOSCFG_KERNEL_CPU_MASK)) { in pthread_attr_setaffinity_np() 256 attr->cpuset = *cpuset; in pthread_attr_setaffinity_np() 265 int pthread_attr_getaffinity_np(const pthread_attr_t* attr, size_t cpusetsize, cpu_set_t* cpuset) in pthread_attr_getaffinity_np() argument 268 if ((attr == NULL) || (cpuset == NULL) || (cpusetsize != sizeof(cpu_set_t))) { in pthread_attr_getaffinity_np() 272 *cpuset in pthread_attr_getaffinity_np() [all...] |
/kernel/linux/linux-6.6/tools/testing/selftests/cgroup/ |
H A D | test_cpuset_prs.sh | 4 # Test for cpuset v2 partition root state (PRS) 63 echo +cpuset > cgroup.subtree_control 102 echo $EXPECTED_VAL > cpuset.cpus.partition 104 ACTUAL_VAL=$(cat cpuset.cpus.partition) 106 echo "cpuset.cpus.partition: expect $EXPECTED_VAL, found $EXPECTED_VAL" 115 ACTUAL_VAL=$(cat cpuset.cpus.effective) 117 echo "cpuset.cpus.effective: expect '$EXPECTED_VAL', found '$EXPECTED_VAL'" 142 echo 2-3 > cpuset.cpus 143 TYPE=$(cat cpuset.cpus.partition) 144 [[ $TYPE = member ]] || echo member > cpuset [all...] |
/kernel/linux/linux-5.10/tools/testing/selftests/powerpc/benchmarks/ |
H A D | fork.c | 32 cpu_set_t cpuset; in set_cpu() local 37 CPU_ZERO(&cpuset); in set_cpu() 38 CPU_SET(cpu, &cpuset); in set_cpu() 40 if (sched_setaffinity(0, sizeof(cpuset), &cpuset)) { in set_cpu() 137 cpu_set_t cpuset; in bench_thread() local 149 CPU_ZERO(&cpuset); in bench_thread() 150 CPU_SET(cpu, &cpuset); in bench_thread() 152 rc = pthread_attr_setaffinity_np(&attr, sizeof(cpu_set_t), &cpuset); in bench_thread()
|
/kernel/linux/linux-6.6/tools/testing/selftests/powerpc/benchmarks/ |
H A D | fork.c | 32 cpu_set_t cpuset; in set_cpu() local 37 CPU_ZERO(&cpuset); in set_cpu() 38 CPU_SET(cpu, &cpuset); in set_cpu() 40 if (sched_setaffinity(0, sizeof(cpuset), &cpuset)) { in set_cpu() 137 cpu_set_t cpuset; in bench_thread() local 149 CPU_ZERO(&cpuset); in bench_thread() 150 CPU_SET(cpu, &cpuset); in bench_thread() 152 rc = pthread_attr_setaffinity_np(&attr, sizeof(cpu_set_t), &cpuset); in bench_thread()
|
/kernel/linux/linux-5.10/tools/testing/selftests/x86/ |
H A D | sysret_ss_attrs.c | 55 cpu_set_t cpuset; in main() local 56 CPU_ZERO(&cpuset); in main() 57 CPU_SET(0, &cpuset); in main() 58 if (sched_setaffinity(0, sizeof(cpuset), &cpuset) != 0) in main()
|
/kernel/linux/linux-5.10/tools/testing/selftests/powerpc/tm/ |
H A D | tm-poison.c | 30 cpu_set_t cpuset; in tm_poison_test() local 42 CPU_ZERO(&cpuset); in tm_poison_test() 43 CPU_SET(cpu, &cpuset); in tm_poison_test() 44 FAIL_IF(sched_setaffinity(0, sizeof(cpuset), &cpuset) != 0); in tm_poison_test()
|
/kernel/linux/linux-6.6/tools/testing/selftests/powerpc/tm/ |
H A D | tm-poison.c | 29 cpu_set_t cpuset; in tm_poison_test() local 42 CPU_ZERO(&cpuset); in tm_poison_test() 43 CPU_SET(cpu, &cpuset); in tm_poison_test() 44 FAIL_IF(sched_setaffinity(0, sizeof(cpuset), &cpuset) != 0); in tm_poison_test()
|