/kernel/liteos_a/testsuites/unittest/process/basic/process/smp/ |
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); /* cpu0 */ in PthreadTest01() [all …]
|
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() [all …]
|
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 …]
|
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 …]
|
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 …]
|
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 …]
|
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()
|
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/linux-5.10/Documentation/admin-guide/cgroup-v1/ |
D | cpusets.rst | 48 the resources within a task's current cpuset. They form a nested 59 policy, are both filtered through that task's cpuset, filtering out any 60 CPUs or Memory Nodes not in that cpuset. The scheduler will not 67 cpusets and which CPUs and Memory Nodes are assigned to each cpuset, 68 specify and query to which cpuset a task is assigned, and list the 69 task pids assigned to a cpuset. 103 The kernel cpuset patch provides the minimum essential kernel 124 - Each task in the system is attached to a cpuset, via a pointer 127 allowed in that task's cpuset. 129 those Memory Nodes allowed in that task's cpuset. [all …]
|
/kernel/linux/build/test/moduletest/runtest/bin/cpusetdecouple_cpuhotplug_t/testcases/bin/ |
D | cpusetdecouple_cpuhotplug02.sh | 31 if mountpoint -q /dev/cpuset; then 34 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.cpus 51 echo $pid > /dev/cpuset/hotplug02/cgroup.procs 54 cat /dev/cpuset/hotplug02/cpuset.cpus 55 cpu_set=$(cat /dev/cpuset/hotplug02/cpuset.cpus) 76 rmdir /dev/cpuset/hotplug02
|
D | cpusetdecouple_cpuhotplug01.sh | 31 if mountpoint -q /dev/cpuset; then 34 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.cpus 54 cat /dev/cpuset/hotplug01/cpuset.cpus 55 cpu_set=$(cat /dev/cpuset/hotplug01/cpuset.cpus) 74 rmdir /dev/cpuset/hotplug01
|
D | cpusetdecouple_cpuhotplug04.sh | 31 if mountpoint -q /dev/cpuset; then 34 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.cpus 54 cat /dev/cpuset/hotplug04/cpuset.cpus 55 cpu_set=$(cat /dev/cpuset/hotplug04/cpuset.cpus) 77 rmdir /dev/cpuset/hotplug04
|
D | cpusetdecouple_cpuhotplug03.sh | 31 if mountpoint -q /dev/cpuset; then 34 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.cpus 50 cpu_set=$(cat /dev/cpuset/hotplug03/cpuset.cpus) 67 echo $pid > /dev/cpuset/hotplug03/cgroup.procs 77 rmdir /dev/cpuset/hotplug03
|
/kernel/liteos_a/testsuites/unittest/process/basic/process/smoke/ |
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 …]
|
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) > 0) ? 1 : 0; in Testcase() [all …]
|
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); // 128, pid num in Testcase() [all …]
|
D | process_test_047.cpp | 48 cpu_set_t cpuset; in Testcase() local 50 CPU_ZERO(&cpuset); in Testcase() 51 temp = sched_getaffinity(getpid(), sizeof(cpu_set_t), &cpuset); in Testcase() 54 temp = CPU_COUNT(&cpuset); in Testcase()
|
/kernel/linux/linux-5.10/kernel/cgroup/ |
D | cpuset.c | 82 struct cpuset { struct 202 static inline struct cpuset *css_cs(struct cgroup_subsys_state *css) in css_cs() 204 return css ? container_of(css, struct cpuset, css) : NULL; in css_cs() 208 static inline struct cpuset *task_cs(struct task_struct *task) in task_cs() 213 static inline struct cpuset *parent_cs(struct cpuset *cs) in parent_cs() 220 struct cpuset *cs = task_cs(p); in inc_dl_tasks_cs() 227 struct cpuset *cs = task_cs(p); in dec_dl_tasks_cs() 245 static inline bool is_cpuset_online(struct cpuset *cs) in is_cpuset_online() 250 static inline int is_cpu_exclusive(const struct cpuset *cs) in is_cpu_exclusive() 255 static inline int is_mem_exclusive(const struct cpuset *cs) in is_mem_exclusive() [all …]
|
/kernel/liteos_a/testsuites/unittest/container/full/ |
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/ |
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 = attr->cpuset; in pthread_attr_getaffinity_np()
|
/kernel/linux/linux-5.10/tools/testing/selftests/x86/ |
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()
|
D | ioperm.c | 90 cpu_set_t cpuset; in main() local 91 CPU_ZERO(&cpuset); in main() 92 CPU_SET(0, &cpuset); in main() 93 if (sched_setaffinity(0, sizeof(cpuset), &cpuset) != 0) in main()
|
/kernel/linux/linux-5.10/tools/testing/selftests/powerpc/tm/ |
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-5.10/tools/testing/selftests/powerpc/benchmarks/ |
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()
|
D | context_switch.c | 78 cpu_set_t cpuset; in start_thread_on() local 81 CPU_ZERO(&cpuset); in start_thread_on() 82 CPU_SET(cpu, &cpuset); in start_thread_on() 91 rc = pthread_attr_setaffinity_np(&attr, sizeof(cpu_set_t), &cpuset); in start_thread_on() 109 cpu_set_t *cpuset; in start_process_on() local 123 cpuset = CPU_ALLOC(ncpus); in start_process_on() 124 if (!cpuset) { in start_process_on() 128 CPU_ZERO_S(size, cpuset); in start_process_on() 129 CPU_SET_S(cpu, size, cpuset); in start_process_on() 131 if (sched_setaffinity(0, size, cpuset)) { in start_process_on() [all …]
|