/linux/kernel/cgroup/ |
H A D | cpuset-internal.h | 9 #include <linux/cpuset.h> 39 /* bits in struct cpuset flags field */ 51 /* The various types of files and directories in a cpuset file system */ 75 struct cpuset { struct 84 * cpuset.cpus and cpuset.mems, and won't be limited by the argument 88 * in the cpuset. They may be changed if the configured masks are 118 * when this cpuset becomes a local partition root. argument 126 * CPUs that can be granted to the current cpuset or its children when argument 140 * - A new cpuset' argument 151 fmetercpuset global() argument 166 partition_root_statecpuset global() argument 176 prs_errcpuset global() argument 186 nodecpuset css_cs() argument [all...] |
H A D | cpuset.c | 2 * kernel/cpuset.c 24 #include "cpuset-internal.h" 48 * There could be abnormal cpuset configurations for cpu or memory 55 [PERR_INVCPUS] = "Invalid cpu list in cpuset.cpus.exclusive", 58 [PERR_NOTEXCL] = "Cpu list in cpuset.cpus not exclusive", 61 [PERR_CPUSEMPTY] = "cpuset.cpus and cpuset.cpus.exclusive are empty", 103 * Note that update_relax_domain_level() in cpuset-v1.c can still call 119 * cpuset.cpus.exclusive are optional in setting up local partitions. 121 * down exclusive CPUs by setting cpuset [all...] |
H A D | cpuset-v1.c | 4 #include "cpuset-internal.h" 11 struct cpuset *cs; 118 * cpuset file 'memory_pressure_enabled' in the root cpuset. 124 * __cpuset_memory_pressure_bump - keep stats of per-cpuset reclaims. 127 * page reclaim efforts initiated by tasks in each cpuset. 129 * This represents the rate at which some task in the cpuset 135 * Display to user space in the per-cpuset read-only file 138 * (direct) page reclaim by any task attached to the cpuset. 148 static int update_relax_domain_level(struct cpuset *c [all...] |
/linux/Documentation/admin-guide/cgroup-v1/ |
H A 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...] |
H A D | memcg_test.rst | 165 For NUMA, migration is an another special case. To do easy test, cpuset 168 mount -t cgroup -o cpuset none /opt/cpuset 170 mkdir /opt/cpuset/01 171 echo 1 > /opt/cpuset/01/cpuset.cpus 172 echo 0 > /opt/cpuset/01/cpuset.mems 173 echo 1 > /opt/cpuset/01/cpuset [all...] |
/linux/tools/testing/selftests/cgroup/ |
H A D | test_cpuset_prs.sh | 4 # Test for cpuset v2 partition root state (PRS) 25 SUBPARTS_CPUS=$CGROUP2/.__DEBUG__.cpuset.cpus.subpartitions 26 CPULIST=$(cat $CGROUP2/cpuset.cpus.effective) 71 echo +cpuset > cgroup.subtree_control 74 # If cpuset has been set up and used in child cgroups, we may not be able to 79 echo 0-6 > test/cpuset.cpus 80 echo root > test/cpuset.cpus.partition 81 cat test/cpuset.cpus.partition | grep -q invalid 83 echo member > test/cpuset.cpus.partition 84 echo "" > test/cpuset [all...] |
H A D | test_cpuset_v1_hp.sh | 4 # Test the special cpuset v1 hotplug case where a cpuset become empty of 16 # Find cpuset v1 mount point 17 CPUSET=$(mount -t cgroup | grep cpuset | head -1 | awk -e '{print $3}') 18 [[ -n "$CPUSET" ]] || skip_test "cpuset v1 mount point not found!" 21 # Create a test cpuset, put a CPU and a task there and offline that CPU 25 echo 1 > $CPUSET/$TDIR/cpuset.cpus 26 echo 0 > $CPUSET/$TDIR/cpuset.mems 30 NEWCS=$(cat /proc/$TASK/cpuset) 32 echo "Unexpected cpuset [all...] |
/linux/tools/testing/selftests/bpf/prog_tests/ |
H A D | free_timer.c | 43 cpu_set_t cpuset; in overwrite_timer_fn() local 47 CPU_ZERO(&cpuset); in overwrite_timer_fn() 48 CPU_SET(0, &cpuset); in overwrite_timer_fn() 49 pthread_setaffinity_np(pthread_self(), sizeof(cpuset), &cpuset); in overwrite_timer_fn() 82 cpu_set_t cpuset; in start_timer_fn() local 86 CPU_ZERO(&cpuset); in start_timer_fn() 87 CPU_SET(1, &cpuset); in start_timer_fn() 88 pthread_setaffinity_np(pthread_self(), sizeof(cpuset), &cpuset); in start_timer_fn() [all...] |
H A D | timer_lockup.c | 27 cpu_set_t cpuset; in timer_lockup_thread() local 29 CPU_ZERO(&cpuset); in timer_lockup_thread() 30 CPU_SET(__sync_fetch_and_add(&cpu, 1), &cpuset); in timer_lockup_thread() 31 ASSERT_OK(pthread_setaffinity_np(pthread_self(), sizeof(cpuset), in timer_lockup_thread() 32 &cpuset), in timer_lockup_thread()
|
H A D | arena_spin_lock.c | 31 cpu_set_t cpuset; in spin_lock_thread() local 33 CPU_ZERO(&cpuset); in spin_lock_thread() 34 CPU_SET(__sync_fetch_and_add(&cpu, 1), &cpuset); in spin_lock_thread() 35 ASSERT_OK(pthread_setaffinity_np(pthread_self(), sizeof(cpuset), &cpuset), "cpu affinity"); in spin_lock_thread()
|
/linux/Documentation/translations/zh_CN/scheduler/ |
H A D | sched-capacity.rst | 272 mkdir /sys/fs/cgroup/cpuset/cs0 273 echo 0-1 > /sys/fs/cgroup/cpuset/cs0/cpuset.cpus 274 echo 0 > /sys/fs/cgroup/cpuset/cs0/cpuset.mems 276 mkdir /sys/fs/cgroup/cpuset/cs1 277 echo 2-7 > /sys/fs/cgroup/cpuset/cs1/cpuset.cpus 278 echo 0 > /sys/fs/cgroup/cpuset/cs1/cpuset [all...] |
/linux/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()
|
H A D | ioperm.c | 69 cpu_set_t cpuset; in main() local 70 CPU_ZERO(&cpuset); in main() 71 CPU_SET(0, &cpuset); in main() 72 if (sched_setaffinity(0, sizeof(cpuset), &cpuset) != 0) in main()
|
H A D | iopl.c | 153 cpu_set_t cpuset; in main() local 155 CPU_ZERO(&cpuset); in main() 156 CPU_SET(0, &cpuset); in main() 157 if (sched_setaffinity(0, sizeof(cpuset), &cpuset) != 0) in main()
|
/linux/tools/sched_ext/ |
H A D | scx_central.c | 52 cpu_set_t *cpuset; in main() local 106 cpuset = CPU_ALLOC(skel->rodata->nr_cpu_ids); in main() 107 SCX_BUG_ON(!cpuset, "Failed to allocate cpuset"); in main() 108 CPU_ZERO_S(CPU_ALLOC_SIZE(skel->rodata->nr_cpu_ids), cpuset); in main() 109 CPU_SET(skel->rodata->central_cpu, cpuset); in main() 110 SCX_BUG_ON(sched_setaffinity(0, sizeof(*cpuset), cpuset), in main() 113 CPU_FREE(cpuset); in main()
|
/linux/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()
|
H A 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...] |
/linux/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()
|
/linux/tools/perf/bench/ |
H A D | futex-wake.c | 103 cpu_set_t *cpuset; in block_threads() local 109 cpuset = CPU_ALLOC(nrcpus); in block_threads() 110 BUG_ON(!cpuset); in block_threads() 118 CPU_ZERO_S(size, cpuset); in block_threads() 119 CPU_SET_S(perf_cpu_map__cpu(cpu, i % perf_cpu_map__nr(cpu)).cpu, size, cpuset); in block_threads() 121 if (pthread_attr_setaffinity_np(&thread_attr, size, cpuset)) { in block_threads() 122 CPU_FREE(cpuset); in block_threads() 127 CPU_FREE(cpuset); in block_threads() 132 CPU_FREE(cpuset); in block_threads()
|
H A D | futex-hash.c | 130 cpu_set_t *cpuset; in bench_futex_hash() local 183 cpuset = CPU_ALLOC(nrcpus); in bench_futex_hash() 184 BUG_ON(!cpuset); in bench_futex_hash() 193 CPU_ZERO_S(size, cpuset); in bench_futex_hash() 195 CPU_SET_S(perf_cpu_map__cpu(cpu, i % perf_cpu_map__nr(cpu)).cpu, size, cpuset); in bench_futex_hash() 196 ret = pthread_attr_setaffinity_np(&thread_attr, size, cpuset); in bench_futex_hash() 198 CPU_FREE(cpuset); in bench_futex_hash() 204 CPU_FREE(cpuset); in bench_futex_hash() 209 CPU_FREE(cpuset); in bench_futex_hash()
|
H A D | futex-lock-pi.c | 126 cpu_set_t *cpuset; in create_threads() local 133 cpuset = CPU_ALLOC(nrcpus); in create_threads() 134 BUG_ON(!cpuset); in create_threads() 150 CPU_ZERO_S(size, cpuset); in create_threads() 151 CPU_SET_S(perf_cpu_map__cpu(cpu, i % perf_cpu_map__nr(cpu)).cpu, size, cpuset); in create_threads() 153 if (pthread_attr_setaffinity_np(&thread_attr, size, cpuset)) { in create_threads() 154 CPU_FREE(cpuset); in create_threads() 159 CPU_FREE(cpuset); in create_threads() 164 CPU_FREE(cpuset); in create_threads()
|
H A D | futex-requeue.c | 129 cpu_set_t *cpuset; in block_threads() local 136 cpuset = CPU_ALLOC(nrcpus); in block_threads() 137 BUG_ON(!cpuset); in block_threads() 145 CPU_ZERO_S(size, cpuset); in block_threads() 146 CPU_SET_S(perf_cpu_map__cpu(cpu, i % perf_cpu_map__nr(cpu)).cpu, size, cpuset); in block_threads() 148 if (pthread_attr_setaffinity_np(&thread_attr, size, cpuset)) { in block_threads() 149 CPU_FREE(cpuset); in block_threads() 154 CPU_FREE(cpuset); in block_threads() 159 CPU_FREE(cpuset); in block_threads()
|
H A D | futex-wake-parallel.c | 153 cpu_set_t *cpuset; in block_threads() local 160 cpuset = CPU_ALLOC(nrcpus); in block_threads() 161 BUG_ON(!cpuset); in block_threads() 169 CPU_ZERO_S(size, cpuset); in block_threads() 170 CPU_SET_S(perf_cpu_map__cpu(cpu, i % perf_cpu_map__nr(cpu)).cpu, size, cpuset); in block_threads() 172 if (pthread_attr_setaffinity_np(&thread_attr, size, cpuset)) { in block_threads() 173 CPU_FREE(cpuset); in block_threads() 178 CPU_FREE(cpuset); in block_threads() 183 CPU_FREE(cpuset); in block_threads()
|
/linux/tools/perf/util/ |
H A D | affinity.c | 91 unsigned long *cpuset = bitmap_zalloc(cpu_set_size * 8); in cpu_map__set_affinity() local 95 if (!cpuset) in cpu_map__set_affinity() 99 __set_bit(cpu.cpu, cpuset); in cpu_map__set_affinity() 101 sched_setaffinity(0, cpu_set_size, (cpu_set_t *)cpuset); in cpu_map__set_affinity() 102 zfree(&cpuset); in cpu_map__set_affinity()
|
/linux/Documentation/translations/zh_CN/mm/ |
H A D | hugetlbfs_reserv.rst |
|