| /linux/lib/ |
| H A D | cpu_rmap.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * cpu_rmap.c: CPU affinity reverse-map support 13 * objects with CPU affinities. This can be seen as a reverse-map of 14 * CPU affinity. However, we do not assume that the object affinities 21 * alloc_cpu_rmap - allocate CPU affinity reverse-map 39 rmap = kzalloc(obj_offset + size * sizeof(rmap->obj[0]), flags); in alloc_cpu_rmap() 43 kref_init(&rmap->refcount); in alloc_cpu_rmap() 44 rmap->obj = (void **)((char *)rmap + obj_offset); in alloc_cpu_rmap() 50 * any newly-hotplugged CPUs to have some object assigned. in alloc_cpu_rmap() 53 rmap->near[cpu].index = cpu % size; in alloc_cpu_rmap() [all …]
|
| /linux/Documentation/driver-api/cxl/platform/acpi/ |
| H A D | srat.rst | 1 .. SPDX-License-Identifier: GPL-2.0 4 SRAT - Static Resource Affinity Table 7 The System/Static Resource Affinity Table describes resource (CPU, Memory) 8 affinity to "Proximity Domains". This table is technically optional, but for 13 created. If things don't look quite the way you expect - check the SRAT Memory 14 Affinity entries and CEDT CFMWS to determine what your platform actually 23 A proximity domain is ROUGHLY equivalent to "NUMA Node" - though a 1-to-1 27 Memory Affinity 30 programming in BIOS - an SRAT entry for that memory needs to be present. 34 Subtable Type : 01 [Memory Affinity] [all …]
|
| /linux/tools/virtio/ringtest/ |
| H A D | run-on-all.sh | 2 # SPDX-License-Identifier: GPL-2.0 4 CPUS_ONLINE=$(lscpu --online -p=cpu|grep -v -e '#') 8 HOST_AFFINITY=$(echo "${CPUS_ONLINE}"|tail -n 1) 16 (echo "$@" | grep -e "--sleep" > /dev/null) || \ 19 echo "GUEST AFFINITY $cpu" 20 "$@" --host-affinity $HOST_AFFINITY --guest-affinity $cpu 23 echo "NO GUEST AFFINITY" 24 "$@" --host-affinity $HOST_AFFINITY 25 echo "NO AFFINITY"
|
| /linux/drivers/infiniband/hw/hfi1/ |
| H A D | affinity.h | 1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ 3 * Copyright(c) 2015 - 2020 Intel Corporation. 35 /* Initialize non-HT cpu cores mask */ 37 /* Initialize driver affinity data */ 40 * Set IRQ affinity to a CPU. The function will determine the 41 * CPU and set the affinity to it. 46 * Remove the IRQ's CPU affinity. This function also updates 52 * Determine a CPU affinity for a user process, if the process does not 53 * have an affinity set yet. 77 struct mutex lock; /* protects affinity nodes */
|
| H A D | affinity.c | 1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause 3 * Copyright(c) 2015 - 2020 Intel Corporation. 12 #include "affinity.h" 35 cpumask_clear(&set->mask); in init_cpu_mask_set() 36 cpumask_clear(&set->used); in init_cpu_mask_set() 37 set->gen = 0; in init_cpu_mask_set() 43 if (cpumask_equal(&set->mask, &set->used)) { in _cpu_mask_set_gen_inc() 48 set->gen++; in _cpu_mask_set_gen_inc() 49 cpumask_clear(&set->used); in _cpu_mask_set_gen_inc() 55 if (cpumask_empty(&set->used) && set->gen) { in _cpu_mask_set_gen_dec() [all …]
|
| /linux/tools/perf/util/ |
| H A D | affinity.c | 1 // SPDX-License-Identifier: GPL-2.0 2 /* Manage affinity to optimize IPIs inside the kernel perf API. */ 11 #include "affinity.h" 15 int sz = cpu__max_cpu().cpu + 8 - 1; in get_cpu_set_size() 25 int affinity__setup(struct affinity *a) in affinity__setup() 29 a->orig_cpus = bitmap_zalloc(cpu_set_size * 8); in affinity__setup() 30 if (!a->orig_cpus) in affinity__setup() 31 return - in affinity__setup() [all...] |
| H A D | affinity.h | 1 // SPDX-License-Identifier: GPL-2.0 8 struct affinity { struct 14 void affinity__cleanup(struct affinity *a); argument 15 void affinity__set(struct affinity *a, int cpu); 16 int affinity__setup(struct affinity *a);
|
| H A D | evlist.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 20 #include "affinity.h" 38 * NOTREADY --(0)--> RUNNING --( 367 struct affinity *affinity; global() member [all...] |
| H A D | mmap.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (C) 2011-2017, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com> 5 * Parts came from evlist.c builtin-{top,stat,record}.c, see those files for further 35 len = bitmap_scnprintf(mask->bits, mask->nbits, buf, MASK_SIZE); in mmap_cpu_mask__scnprintf() 37 pr_debug("%p: %s mask[%zd]: %s\n", mask, tag, mask->nbits, buf); in mmap_cpu_mask__scnprintf() 42 return perf_mmap__mmap_len(&map->cor in mmap__mmap_len() 98 perf_mmap__aio_bind(struct mmap * map,int idx,struct perf_cpu cpu,int affinity) perf_mmap__aio_bind() argument [all...] |
| /linux/tools/testing/selftests/rseq/ |
| H A D | basic_test.c | 1 // SPDX-License-Identifier: LGPL-2.1 18 cpu_set_t affinity, test_affinity; in test_cpu_pointer() local 21 sched_getaffinity(0, sizeof(affinity), &affinity); in test_cpu_pointer() 24 if (CPU_ISSET(i, &affinity)) { in test_cpu_pointer() 39 sched_setaffinity(0, sizeof(affinity), &affinity); in test_cpu_pointer() 59 return -1; in main()
|
| H A D | slice_test.c | 1 // SPDX-License-Identifier: LGPL-2.1 97 int64_t delta = now->tv_sec - start->tv_sec; in elapsed() 100 delta += now->tv_nsec - start->tv_nsec; in elapsed() 108 while (RSEQ_READ_ONCE(p->run)) { in noise_thread() 114 } while (!elapsed(&ts_start, &ts_now, p->noise_nsecs)); in noise_thread() 117 ts_start.tv_nsec = p->sleep_nsecs; in noise_thread() 125 cpu_set_t affinity; in FIXTURE_SETUP() local 134 ASSERT_EQ(sched_getaffinity(0, sizeof(affinity), &affinity), 0); in FIXTURE_SETUP() 138 if (!CPU_ISSET(i, &affinity)) in FIXTURE_SETUP() 141 CPU_ZERO(&affinity); in FIXTURE_SETUP() [all …]
|
| /linux/tools/power/cpupower/bench/ |
| H A D | system.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* cpufreq-bench CPUFreq microbenchmark 43 * @retval -1 when failed 54 return -1; in set_cpufreq_governor() 60 return -1; in set_cpufreq_governor() 67 * sets cpu affinity for the process 69 * @param cpu cpu# to which the affinity should be set 72 * @retval -1 when setting the affinity failed 82 dprintf("set affinity to cpu #%u\n", cpu); in set_cpu_affinity() 86 fprintf(stderr, "warning: unable to set cpu affinity\n"); in set_cpu_affinity() [all …]
|
| /linux/include/linux/ |
| H A D | cpu_rmap.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 6 * cpu_rmap.c: CPU affinity reverse-map support 16 * struct cpu_rmap - CPU affinity reverse-map 18 * @size: Number of objects to be reverse-mapped 21 * based on affinity masks 40 const struct cpumask *affinity); 44 return rmap->near[cpu].index; in cpu_rmap_lookup_index() 49 return rmap->obj[rmap->near[cpu].index]; in cpu_rmap_lookup_obj() 53 * alloc_irq_cpu_rmap - allocate CPU affinity reverse-map for IRQs
|
| /linux/Documentation/core-api/ |
| H A D | workqueue.rst | 33 thread system-wide. A single MT wq needed to keep around the same 60 * Use per-CPU unified worker pools shared by all wq to provide 85 worker-pools. 87 The cmwq design differentiates between the user-facing workqueues that 89 which manages worker-pools and processes the queued work items. 91 There are two worker-pools, one for normal work items and the other 93 worker-pools to serve work items queued on unbound workqueues - the 98 Each per-CPU BH worker pool contains only one pseudo worker which represents 110 When a work item is queued to a workqueue, the target worker-pool is 112 and appended on the shared worklist of the worker-pool. For example, [all …]
|
| /linux/kernel/irq/ |
| H A D | manage.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar 4 * Copyright (C) 2005-2006 Thomas Gleixner 42 irq_work_sync(&desc->redirect.work); in synchronize_irqwork() 60 while (irqd_irq_inprogress(&desc->irq_data)) in __synchronize_hardirq() 63 /* Ok, that indicated we're done: double-check carefully. */ in __synchronize_hardirq() 64 guard(raw_spinlock_irqsave)(&desc->lock); in __synchronize_hardirq() 65 inprogress = irqd_irq_inprogress(&desc->irq_data); in __synchronize_hardirq() 85 * synchronize_hardirq - wait for pending hard IRQ handlers (on other CPUs) 98 * This function may be called - with care - from IRQ context. [all …]
|
| H A D | irq_test.c | 1 // SPDX-License-Identifier: LGPL-2.1+ 49 virq = irq_domain_alloc_descs(-1, 1, 0, NUMA_NO_NODE, affd); in irq_test_setup_fake_irq() 76 KUNIT_EXPECT_EQ(test, desc->depth, 0); in irq_disable_depth_test() 79 KUNIT_EXPECT_EQ(test, desc->depth, 1); in irq_disable_depth_test() 82 KUNIT_EXPECT_EQ(test, desc->depth, 0); in irq_disable_depth_test() 100 KUNIT_EXPECT_EQ(test, desc->depth, 0); in irq_free_disabled_test() 103 KUNIT_EXPECT_EQ(test, desc->depth, 1); in irq_free_disabled_test() 106 KUNIT_EXPECT_GE(test, desc->depth, 1); in irq_free_disabled_test() 110 KUNIT_EXPECT_EQ(test, desc->depth, 0); in irq_free_disabled_test() 120 struct irq_affinity_desc affinity = { in irq_shutdown_depth_test() local [all …]
|
| /linux/tools/testing/selftests/cgroup/ |
| H A D | test_cpuset.c | 1 // SPDX-License-Identifier: GPL-2.0 53 if (cg_write(parent, "cgroup.subtree_control", "-cpuset")) in do_controller_fn() 113 /* Enable permissions along src->dst tree path */ in test_cpuset_perms_object() 114 if (chown(child_src_procs, test_euid, -1) || in test_cpuset_perms_object() 115 chown(child_dst_procs, test_euid, -1)) in test_cpuset_perms_object() 118 if (allow && chown(parent_procs, test_euid, -1)) in test_cpuset_perms_object() 203 if (chown(parent_procs, test_euid, -1) || in test_cpuset_perms_subtree() 204 chown(parent_subctl, test_euid, -1) || in test_cpuset_perms_subtree() 205 chown(child_procs, test_euid, -1)) in test_cpuset_perms_subtree() 212 * internal-node constraing violation. in test_cpuset_perms_subtree() [all …]
|
| /linux/drivers/md/ |
| H A D | dm-ps-io-affinity.c | 1 // SPDX-License-Identifier: GPL-2.0-only 7 #include "dm-path-selector.h" 9 #include <linux/device-mapper.h> 12 #define DM_MSG_PREFIX "multipath io-affinity" 29 struct path_info *pi = s->path_map[cpu]; in ioa_free_path() 34 if (refcount_dec_and_test(&pi->refcount)) { in ioa_free_path() 35 cpumask_clear_cpu(cpu, s->path_mask); in ioa_free_path() 36 free_cpumask_var(pi->cpumask); in ioa_free_path() 39 s->path_map[cpu] = NULL; in ioa_free_path() 46 struct selector *s = ps->context; in ioa_add_path() [all …]
|
| /linux/Documentation/devicetree/bindings/interrupt-controller/ |
| H A D | apple,aic.yaml | 1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 3 --- 4 $id: http://devicetree.org/schemas/interrupt-controller/apple,aic.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 10 - Hector Martin <marcan@marcan.st> 19 - Level-triggered hardware IRQs wired to SoC blocks 20 - Single mask bit per IRQ 21 - Per-IRQ affinity setting 22 - Automatic masking on event delivery (auto-ack) 23 - Software triggering (ORed with hw line) [all …]
|
| /linux/Documentation/driver-api/cxl/platform/example-configurations/ |
| H A D | flexible.rst | 1 .. SPDX-License-Identifier: GPL-2.0 15 * Cross-Bridge interleave is described in one CFMWS that covers all capacity. 16 * One CFMWS is also described per-host bridge. 17 * One CFMWS is also described per-device. 142 Subtable Type : 01 [Memory Affinity] 152 Non-Volatile : 0 154 Subtable Type : 01 [Memory Affinity] 164 Non-Volatile : 0 166 Subtable Type : 01 [Memory Affinity] 176 Non-Volatile : 0 [all …]
|
| /linux/drivers/gpu/drm/amd/amdkfd/ |
| H A D | kfd_crat.h | 1 /* SPDX-License-Identifier: GPL-2.0 OR MIT */ 3 * Copyright 2014-2022 Advanced Micro Devices, Inc. 87 * ComputeUnit Affinity structure and definitions 122 * HSA Memory Affinity structure and definitions 143 uint8_t reserved2[CRAT_MEMORY_RESERVED_LENGTH - 1]; 147 * HSA Cache Affinity structure and definitions 176 * HSA TLB Affinity structure and definitions 211 * HSA CCompute/APU Affinity structure and definitions 230 * HSA IO Link Affinity structure and definitions 279 uint8_t reserved2[CRAT_IOLINK_RESERVED_LENGTH - 1]; [all …]
|
| /linux/kernel/ |
| H A D | kthread.c | 1 // SPDX-License-Identifier: GPL-2.0-only 84 WARN_ON(!(k->flags & PF_KTHREAD)); in to_kthread() 85 return k->worker_private; in to_kthread() 92 if (!kthread || !kthread->full_name) { in get_kthread_comm() 93 strscpy(buf, tsk->comm, buf_size); in get_kthread_comm() 97 strscpy_pad(buf, kthread->full_name, buf_size); in get_kthread_comm() 111 init_completion(&kthread->exited); in set_kthread_struct() 112 init_completion(&kthread->parked); in set_kthread_struct() 113 INIT_LIST_HEAD(&kthread->affinity_node); in set_kthread_struct() 114 p->vfork_done = &kthread->exited; in set_kthread_struct() [all …]
|
| /linux/tools/testing/selftests/bpf/ |
| H A D | bench.c | 1 // SPDX-License-Identifier: GPL-2.0 19 .affinity = false, 41 long total = res->false_hits + res->hits + res->drops; in false_hits_report_progress() 44 iter, (delta_ns - 1000000000) / 1000.0); in false_hits_report_progress() 47 res->false_hits, total, ((float)res->false_hits / total) * 100); in false_hits_report_progress() 73 hits_per_sec = res->hits / 1000000.0 / (delta_ns / 1000000000.0); in hits_drops_report_progress() 75 drops_per_sec = res->drops / 1000000.0 / (delta_ns / 1000000000.0); in hits_drops_report_progress() 78 iter, (delta_ns - 1000000000) / 1000.0); in hits_drops_report_progress() 92 gp_stat->mean += res[i].gp_ns / 1000.0 / (double)res[i].gp_ct / (0.0 + res_cnt); in grace_period_latency_basic_stats() 94 #define IT_MEAN_DIFF (res[i].gp_ns / 1000.0 / (double)res[i].gp_ct - gp_stat->mean) in grace_period_latency_basic_stats() [all …]
|
| /linux/Documentation/translations/zh_CN/core-api/irq/ |
| H A D | irq-affinity.rst | 1 .. include:: ../../disclaimer-zh_CN.rst 3 :Original: Documentation/core-api/irq/irq-affinity.rst 9 .. _cn_irq-affinity.rst: 16 - 作者:最初由Ingo Molnar <mingo@redhat.com>开始撰写 17 - 后期更新维护: Max Krasnyansky <maxk@qualcomm.com> 23 (IRQ affinity),那么所有cpu的默认值将保持不变(即关联到所有CPU). 28 下面是一个先将IRQ44(eth1)限制在CPU0-3上,然后限制在CPU4-7上的例子(这是一个8CPU的SMP box) 39 [root@moon 44]# ping -f h 42 --- hell ping statistics --- 44 round-trip min/avg/max = 0.1/0.1/0.4 ms [all …]
|
| /linux/arch/arm64/kernel/ |
| H A D | sleep.S | 1 /* SPDX-License-Identifier: GPL-2.0 */ 4 #include <asm/asm-offsets.h> 14 * @rs0: register containing affinity level 0 bit shift 15 * @rs1: register containing affinity level 1 bit shift 16 * @rs2: register containing affinity level 2 bit shift 17 * @rs3: register containing affinity level 3 bit shift 21 * Pseudo C-code: 58 * link-register is saved and restored, it will appear to return from this 60 * __cpu_suspend_enter() will always return a non-zero value, whereas the 93 stp x29, lr, [sp, #-16]! [all …]
|