/kernel/linux/linux-5.10/kernel/sched/ |
D | sched_avg.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (c) 2012, 2015-2021, The Linux Foundation. All rights reserved. 21 static DEFINE_PER_CPU(u64, nr); 43 int cpu; in sched_get_nr_running_avg() local 45 u64 period = curr_time - last_get_time; in sched_get_nr_running_avg() 52 for_each_possible_cpu(cpu) { in sched_get_nr_running_avg() 56 spin_lock_irqsave(&per_cpu(nr_lock, cpu), flags); in sched_get_nr_running_avg() 58 diff = curr_time - per_cpu(last_time, cpu); in sched_get_nr_running_avg() 61 tmp_nr = per_cpu(nr_prod_sum, cpu); in sched_get_nr_running_avg() 62 tmp_nr += per_cpu(nr, cpu) * diff; in sched_get_nr_running_avg() [all …]
|
/kernel/linux/linux-5.10/tools/perf/util/ |
D | cpumap.c | 1 // SPDX-License-Identifier: GPL-2.0 25 map = perf_cpu_map__empty_new(cpus->nr); in cpu_map__from_entries() 29 for (i = 0; i < cpus->nr; i++) { in cpu_map__from_entries() 31 * Special treatment for -1, which is not real cpu number, in cpu_map__from_entries() 32 * and we need to use (int) -1 to initialize map[i], in cpu_map__from_entries() 35 if (cpus->cpu[i] == (u16) -1) in cpu_map__from_entries() 36 map->map[i] = -1; in cpu_map__from_entries() 38 map->map[i] = (int) cpus->cpu[i]; in cpu_map__from_entries() 48 int nr, nbits = mask->nr * mask->long_size * BITS_PER_BYTE; in cpu_map__from_mask() local 50 nr = bitmap_weight(mask->mask, nbits); in cpu_map__from_mask() [all …]
|
D | cputopo.c | 1 // SPDX-License-Identifier: GPL-2.0 17 "%s/devices/system/cpu/cpu%d/topology/core_siblings_list" 19 "%s/devices/system/cpu/cpu%d/topology/die_cpus_list" 21 "%s/devices/system/cpu/cpu%d/topology/thread_siblings_list" 23 "%s/devices/system/cpu/cpu%d/topology/core_cpus_list" 31 static int build_cpu_topology(struct cpu_topology *tp, int cpu) in build_cpu_topology() argument 39 int ret = -1; in build_cpu_topology() 42 sysfs__mountpoint(), cpu); in build_cpu_topology() 56 for (i = 0; i < tp->core_sib; i++) { in build_cpu_topology() 57 if (!strcmp(buf, tp->core_siblings[i])) in build_cpu_topology() [all …]
|
D | thread-stack.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * thread-stack.c: Synthesize a thread's stack using call / return events 21 #include "call-path.h" 22 #include "thread-stack.h" 40 * struct thread_stack_entry - thread stack entry. 47 * @db_id: id used for db-export 68 * struct thread_stack - thread stack constructed from 'call' and 'return' 110 * perf_session__register_idle_thread(). The idle task is really 1 task per cpu, 111 * and therefore requires a stack for each cpu. 115 return !(thread->tid || thread->pid_); in thread_stack__per_cpu() [all …]
|
D | stat-display.c | 27 if (config->csv_output) { in print_running() 28 fprintf(config->output, "%s%" PRIu64 "%s%.2f", in print_running() 29 config->csv_sep, in print_running() 31 config->csv_sep, in print_running() 34 fprintf(config->output, " (%.2f%%)", 100.0 * run / ena); in print_running() 43 if (config->csv_output) in print_noise_pct() 44 fprintf(config->output, "%s%.2f%%", config->csv_sep, pct); in print_noise_pct() 46 fprintf(config->output, " ( +-%6.2f%% )", pct); in print_noise_pct() 54 if (config->run_count == 1) in print_noise() 57 ps = evsel->stats; in print_noise() [all …]
|
/kernel/linux/linux-5.10/arch/mips/sgi-ip27/ |
D | ip27-nmi.c | 1 // SPDX-License-Identifier: GPL-2.0 42 if (nmi_addr->call_addr) in install_cpu_nmi_handler() 44 nmi_addr->magic = NMI_MAGIC; in install_cpu_nmi_handler() 45 nmi_addr->call_addr = (void *)nmi_dump; in install_cpu_nmi_handler() 46 nmi_addr->call_addr_c = in install_cpu_nmi_handler() 47 (void *)(~((unsigned long)(nmi_addr->call_addr))); in install_cpu_nmi_handler() 48 nmi_addr->call_parm = 0; in install_cpu_nmi_handler() 52 * Copy the cpu registers which have been saved in the IP27prom format 58 struct reg_struct *nr; in nmi_cpu_eframe_save() local 61 /* Get the pointer to the current cpu's register set. */ in nmi_cpu_eframe_save() [all …]
|
/kernel/linux/linux-5.10/Documentation/devicetree/bindings/powerpc/ |
D | ibm,powerpc-cpu-features.txt | 3 (skiboot/doc/device-tree/ibm,powerpc-cpu-features/binding.txt) 9 ibm,powerpc-cpu-features binding 12 This device tree binding describes CPU features available to software, with 19 /cpus/ibm,powerpc-cpu-features node binding 20 ------------------------------------------- 22 Node: ibm,powerpc-cpu-features 24 Description: Container of CPU feature nodes. 26 The node name must be "ibm,powerpc-cpu-features". 35 - compatible 38 Definition: "ibm,powerpc-cpu-features" [all …]
|
/kernel/linux/linux-5.10/arch/powerpc/platforms/85xx/ |
D | smp.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 6 * Copyright 2006-2008, 2011-2012, 2015 Freescale Semiconductor Inc. 17 #include <linux/cpu.h> 26 #include <asm/code-patching.h> 58 qoriq_pm_ops->freeze_time_base(true); in mpc85xx_give_timebase() 61 * e5500/e6500 have a workaround for erratum A-006958 in place in mpc85xx_give_timebase() 62 * that will reread the timebase until TBL is non-zero. in mpc85xx_give_timebase() 66 * TBL is non-zero, we ensure that TB does not change. We don't in mpc85xx_give_timebase() 91 qoriq_pm_ops->freeze_time_base(false); in mpc85xx_give_timebase() 117 unsigned int cpu = smp_processor_id(); in smp_85xx_cpu_offline_self() local [all …]
|
/kernel/linux/linux-5.10/arch/powerpc/platforms/powernv/ |
D | smp.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 17 #include <linux/cpu.h> 31 #include <asm/code-patching.h> 34 #include <asm/ppc-opcode.h> 49 static void pnv_smp_setup_cpu(int cpu) in pnv_smp_setup_cpu() argument 60 else if (cpu != boot_cpuid) in pnv_smp_setup_cpu() 64 static int pnv_smp_kick_cpu(int nr) in pnv_smp_kick_cpu() argument 72 if (nr < 0 || nr >= nr_cpu_ids) in pnv_smp_kick_cpu() 73 return -EINVAL; in pnv_smp_kick_cpu() 75 pcpu = get_hard_smp_processor_id(nr); in pnv_smp_kick_cpu() [all …]
|
/kernel/linux/linux-5.10/tools/perf/tests/ |
D | cpumap.c | 1 // SPDX-License-Identifier: GPL-2.0 6 #include "util/synthetic-events.h" 19 struct perf_record_cpu_map *map_event = &event->cpu_map; in process_event_mask() 25 data = &map_event->data; in process_event_mask() 27 TEST_ASSERT_VAL("wrong type", data->type == PERF_CPU_MAP__MASK); in process_event_mask() 29 mask = (struct perf_record_record_cpu_map *)data->data; in process_event_mask() 31 TEST_ASSERT_VAL("wrong nr", mask->nr == 1); in process_event_mask() 34 TEST_ASSERT_VAL("wrong cpu", test_bit(i, mask->mask)); in process_event_mask() 38 TEST_ASSERT_VAL("wrong nr", map->nr == 20); in process_event_mask() 41 TEST_ASSERT_VAL("wrong cpu", map->map[i] == i); in process_event_mask() [all …]
|
D | openat-syscall-all-cpus.c | 1 // SPDX-License-Identifier: GPL-2.0 25 int err = -1, fd, cpu; in test__openat_syscall_event_on_all_cpus() local 30 struct perf_thread_map *threads = thread_map__new(-1, getpid(), UINT_MAX); in test__openat_syscall_event_on_all_cpus() 36 return -1; in test__openat_syscall_event_on_all_cpus() 61 for (cpu = 0; cpu < cpus->nr; ++cpu) { in test__openat_syscall_event_on_all_cpus() 62 unsigned int ncalls = nr_openat_calls + cpu; in test__openat_syscall_event_on_all_cpus() 67 * a reasonable upper limit tho :-) in test__openat_syscall_event_on_all_cpus() 69 if (cpus->map[cpu] >= CPU_SETSIZE) { in test__openat_syscall_event_on_all_cpus() 70 pr_debug("Ignoring CPU %d\n", cpus->map[cpu]); in test__openat_syscall_event_on_all_cpus() 74 CPU_SET(cpus->map[cpu], &cpu_set); in test__openat_syscall_event_on_all_cpus() [all …]
|
D | switch-tracking.c | 1 // SPDX-License-Identifier: GPL-2.0 14 #include "parse-events.h" 72 union perf_event *event, const char *comm, int nr) in check_comm() argument 74 if (event->header.type == PERF_RECORD_COMM && in check_comm() 75 (pid_t)event->comm.pid == getpid() && in check_comm() 76 (pid_t)event->comm.tid == getpid() && in check_comm() 77 strcmp(event->comm.comm, comm) == 0) { in check_comm() 78 if (switch_tracking->comm_seen[nr]) { in check_comm() 80 return -1; in check_comm() 82 switch_tracking->comm_seen[nr] = 1; in check_comm() [all …]
|
/kernel/linux/linux-5.10/tools/testing/selftests/vm/ |
D | userfaultfd.c | 1 // SPDX-License-Identifier: GPL-2.0-only 11 * There are three threads running per CPU: 13 * 1) one per-CPU thread takes a per-page pthread_mutex in a random 15 * area_src), and increments a per-page counter in the same page, 18 * 2) another per-CPU thread handles the userfaults generated by 22 * 3) one last per-CPU thread transfers the memory in the background 24 * 2). Each cpu thread takes cares of transferring a portion of the 32 * per-CPU threads 1 by triggering userfaults inside 81 /* Whether to test uffd write-protection */ 95 int cpu; member [all …]
|
/kernel/linux/linux-5.10/arch/powerpc/platforms/86xx/ |
D | mpc86xx_smp.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 15 #include <asm/code-patching.h> 17 #include <asm/pci-bridge.h> 35 smp_86xx_release_core(int nr) in smp_86xx_release_core() argument 40 if (nr < 0 || nr >= NR_CPUS) in smp_86xx_release_core() 44 * Startup Core #nr. in smp_86xx_release_core() 49 pcr |= 1 << (nr + 24); in smp_86xx_release_core() 57 smp_86xx_kick_cpu(int nr) in smp_86xx_kick_cpu() argument 64 if (nr < 0 || nr >= NR_CPUS) in smp_86xx_kick_cpu() 65 return -ENOENT; in smp_86xx_kick_cpu() [all …]
|
/kernel/linux/linux-5.10/tools/lib/perf/ |
D | cpumap.c | 1 // SPDX-License-Identifier: GPL-2.0-only 18 cpus->nr = 1; in perf_cpu_map__dummy_new() 19 cpus->map[0] = -1; in perf_cpu_map__dummy_new() 20 refcount_set(&cpus->refcnt, 1); in perf_cpu_map__dummy_new() 29 WARN_ONCE(refcount_read(&map->refcnt) != 0, in cpu_map__delete() 38 refcount_inc(&map->refcnt); in perf_cpu_map__get() 44 if (map && refcount_dec_and_test(&map->refcnt)) in perf_cpu_map__put() 62 cpus->map[i] = i; in cpu_map__default_new() 64 cpus->nr = nr_cpus; in cpu_map__default_new() 65 refcount_set(&cpus->refcnt, 1); in cpu_map__default_new() [all …]
|
D | evsel.c | 1 // SPDX-License-Identifier: GPL-2.0 21 INIT_LIST_HEAD(&evsel->node); in perf_evsel__init() 22 evsel->attr = *attr; in perf_evsel__init() 40 #define FD(e, x, y) (*(int *) xyarray__entry(e->fd, x, y)) 44 evsel->fd = xyarray__new(ncpus, nthreads, sizeof(int)); in perf_evsel__alloc_fd() 46 if (evsel->fd) { in perf_evsel__alloc_fd() 47 int cpu, thread; in perf_evsel__alloc_fd() local 48 for (cpu = 0; cpu < ncpus; cpu++) { in perf_evsel__alloc_fd() 50 FD(evsel, cpu, thread) = -1; in perf_evsel__alloc_fd() 55 return evsel->fd != NULL ? 0 : -ENOMEM; in perf_evsel__alloc_fd() [all …]
|
/kernel/linux/linux-5.10/arch/powerpc/include/asm/ |
D | smp.h | 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 3 * smp.h: PowerPC-specific SMP code. 9 * Copyright (C) 1996-2001 Cort Dougan <cort@fsmlabs.com> 33 extern int cpu_to_chip_id(int cpu); 38 void (*message_pass)(int cpu, int msg); 40 void (*cause_ipi)(int cpu); 42 int (*cause_nmi_ipi)(int cpu); 44 int (*kick_cpu)(int nr); 45 int (*prepare_cpu)(int nr); 46 void (*setup_cpu)(int nr); [all …]
|
/kernel/linux/linux-5.10/tools/perf/Documentation/ |
D | perf.data-file-format.txt | 5 This document describes the on-disk perf.data format, generated by perf record 10 All fields are in native-endian of the machine that generated the perf.data. 14 format is described in "Pipe-mode data" section. The pipe data version can be 33 magic value is 64bit byte swapped compared the file is in non-native 61 uint32_t nr; 62 struct perf_header_string strings[nr]; /* variable length records */ 85 char filename[header.size - offsetof(struct build_id_event, filename)]; 91 (uname -n) 96 (uname -r) 106 A perf_header_string with the CPU architecture (uname -m) [all …]
|
/kernel/linux/linux-5.10/arch/x86/include/asm/ |
D | bitops.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 32 * These have to be done with inline assembly: that way the bit-setting 48 #define CONST_MASK_ADDR(nr, addr) WBYTE_ADDR((void *)(addr) + ((nr)>>3)) argument 49 #define CONST_MASK(nr) (1 << ((nr) & 7)) argument 52 arch_set_bit(long nr, volatile unsigned long *addr) in arch_set_bit() argument 54 if (__builtin_constant_p(nr)) { in arch_set_bit() 56 : CONST_MASK_ADDR(nr, addr) in arch_set_bit() 57 : "iq" (CONST_MASK(nr)) in arch_set_bit() 61 : : RLONG_ADDR(addr), "Ir" (nr) : "memory"); in arch_set_bit() 66 arch___set_bit(long nr, volatile unsigned long *addr) in arch___set_bit() argument [all …]
|
/kernel/linux/linux-5.10/mm/ |
D | swap_slots.c | 1 // SPDX-License-Identifier: GPL-2.0 11 * it into local per cpu caches. This has the advantage 31 #include <linux/cpu.h> 68 /* Must not be called with cpu hot plug lock */ 74 /* serialize with cpu hotplug operations */ in disable_swap_slots_cache_lock() 114 static int alloc_swap_slot_cache(unsigned int cpu) in alloc_swap_slot_cache() argument 127 return -ENOMEM; in alloc_swap_slot_cache() 133 return -ENOMEM; in alloc_swap_slot_cache() 137 cache = &per_cpu(swp_slots, cpu); in alloc_swap_slot_cache() 138 if (cache->slots || cache->slots_ret) { in alloc_swap_slot_cache() [all …]
|
/kernel/linux/linux-5.10/include/xen/ |
D | xen-ops.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 15 static inline uint32_t xen_vcpu_nr(int cpu) in xen_vcpu_nr() argument 17 return per_cpu(xen_vcpu_id, cpu); in xen_vcpu_nr() 35 void xen_setup_runstate_info(int cpu); 39 u64 xen_steal_clock(int cpu); 66 xen_pfn_t *pfn, int nr, int *err_ptr, pgprot_t prot, 70 xen_pfn_t *pfn, int nr, int *err_ptr, in xen_remap_pfn() argument 84 xen_pfn_t *gfn, int nr, 89 int nr, struct page **pages); 97 xen_pfn_t *gfn, int nr, in xen_xlate_remap_gfn_array() argument [all …]
|
/kernel/linux/linux-5.10/drivers/macintosh/ |
D | windfarm_smu_sat.c | 1 // SPDX-License-Identifier: GPL-2.0-only 29 int nr; member 60 /* TODO: Add the resulting partition to the device-tree */ in smu_sat_get_sdb_partition() 65 err = i2c_smbus_write_word_data(sat->i2c, 8, id << 8); in smu_sat_get_sdb_partition() 71 err = i2c_smbus_read_word_data(sat->i2c, 9); in smu_sat_get_sdb_partition() 89 err = i2c_smbus_read_i2c_block_data(sat->i2c, 0xa, 4, data); in smu_sat_get_sdb_partition() 119 err = i2c_smbus_read_i2c_block_data(sat->i2c, 0x3f, 16, sat->cache); in wf_sat_read_cache() 122 sat->last_read = jiffies; in wf_sat_read_cache() 129 16, 1, sat->cache, 16, false); in wf_sat_read_cache() 138 struct wf_sat *sat = sens->sat; in wf_sat_sensor_get() [all …]
|
/kernel/linux/linux-5.10/include/linux/ |
D | sbitmap.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 6 * Copyright (C) 2013-2014 Jens Axboe 18 * struct sbitmap_word - Word in a &struct sbitmap. 37 * @swap_lock: Held while swapping word <-> cleared 43 * struct sbitmap - Scalable bitmap. 45 * A &struct sbitmap is spread over multiple cachelines to avoid ping-pong. This 74 * struct sbq_wait_state - Wait queue in a &struct sbitmap_queue. 89 * struct sbitmap_queue - Scalable bitmap with the added ability to wait on free 106 * This is per-cpu, which allows multiple users to stick to different 133 * @round_robin: Allocate bits in strict round-robin order. [all …]
|
/kernel/linux/linux-5.10/arch/powerpc/platforms/cell/ |
D | smp.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 23 #include <linux/cpu.h> 39 #include <asm/code-patching.h> 51 * The Primary thread of each non-boot processor was started from the OF client 57 * smp_startup_cpu() - start the given cpu 64 * 0 - failure 65 * 1 - success 82 * If the RTAS start-cpu token does not exist then presume the in smp_startup_cpu() 83 * cpu is already spinning. in smp_startup_cpu() 85 start_cpu = rtas_token("start-cpu"); in smp_startup_cpu() [all …]
|
/kernel/linux/build/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/ |
D | cpuisolation02.sh | 5 # SPDX-License-Identifier: GPL-2.0 16 # Description: check CPU lightweight isolation basic function 18 # Authors: liudanning - liudanning@h-partners.com 20 # History: Mar 24 2022 - init scripts 34 dir_name=/sys/devices/system/cpu/cpu0/core_ctl 37 cpu_total=$(cat /proc/cpuinfo | grep "processor"| wc -l) 38 cpu_total=$(( $cpu_total - 1 )) 41 touch cpu${i}_taskpid.txt 44 tst_res TINFO "Start to check CPU lightweight isolation basic function." 55 # check sh distributed on each CPU [all …]
|