| /kernel/linux/linux-6.6/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/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 …]
|
| /kernel/linux/linux-6.6/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/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-6.6/tools/perf/util/ |
| D | cputopo.c | 1 // SPDX-License-Identifier: GPL-2.0 19 "%s/devices/system/cpu/cpu%d/topology/package_cpus_list" 21 "%s/devices/system/cpu/cpu%d/topology/core_siblings_list" 23 "%s/devices/system/cpu/cpu%d/topology/die_cpus_list" 25 "%s/devices/system/cpu/cpu%d/topology/core_cpus_list" 27 "%s/devices/system/cpu/cpu%d/topology/thread_siblings_list" 35 static int build_cpu_topology(struct cpu_topology *tp, int cpu) in build_cpu_topology() argument 43 int ret = -1; in build_cpu_topology() 46 sysfs__mountpoint(), cpu); in build_cpu_topology() 47 if (access(filename, F_OK) == -1) { in build_cpu_topology() [all …]
|
| D | cpumap.c | 1 // SPDX-License-Identifier: GPL-2.0 22 * CPU number. 34 return (data->mask32_data.long_size == 4) in perf_record_cpu_map_data__test_bit() 35 ? (bit_word32 < data->mask32_data.nr) && in perf_record_cpu_map_data__test_bit() 36 (data->mask32_data.mask[bit_word32] & bit_mask32) != 0 in perf_record_cpu_map_data__test_bit() 37 : (bit_word64 < data->mask64_data.nr) && in perf_record_cpu_map_data__test_bit() 38 (data->mask64_data.mask[bit_word64] & bit_mask64) != 0; in perf_record_cpu_map_data__test_bit() 41 /* Read ith mask value from data into the given 64-bit sized bitmap */ 46 if (data->mask32_data.long_size == 4) in perf_record_cpu_map_data__read_one_mask() 47 bitmap[0] = data->mask32_data.mask[i]; in perf_record_cpu_map_data__read_one_mask() [all …]
|
| /kernel/linux/linux-6.6/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/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-6.6/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/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-6.6/fs/btrfs/ |
| D | accessors.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 92 const type *p = page_address(eb->pages[0]) + \ 93 offset_in_page(eb->start); \ 94 return get_unaligned_le##bits(&p->member); \ 99 type *p = page_address(eb->pages[0]) + offset_in_page(eb->start); \ 100 put_unaligned_le##bits(val, &p->member); \ 106 return get_unaligned_le##bits(&s->member); \ 110 put_unaligned_le##bits(val, &s->member); \ 124 WARN_ON(!IS_ALIGNED(val, eb->fs_info->sectorsize)); in btrfs_set_device_total_bytes() 203 static inline struct btrfs_stripe *btrfs_stripe_nr(struct btrfs_chunk *c, int nr) in btrfs_stripe_nr() argument [all …]
|
| /kernel/linux/linux-6.6/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/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 …]
|
| /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-6.6/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() 24 data = &map_event->data; in process_event_mask() 26 TEST_ASSERT_VAL("wrong type", data->type == PERF_CPU_MAP__MASK); in process_event_mask() 28 long_size = data->mask32_data.long_size; in process_event_mask() 32 TEST_ASSERT_VAL("wrong nr", data->mask32_data.nr == 1); in process_event_mask() 34 TEST_ASSERT_VAL("wrong cpu", perf_record_cpu_map_data__test_bit(0, data)); in process_event_mask() 35 TEST_ASSERT_VAL("wrong cpu", !perf_record_cpu_map_data__test_bit(1, data)); in process_event_mask() 37 TEST_ASSERT_VAL("wrong cpu", perf_record_cpu_map_data__test_bit(i, data)); in process_event_mask() [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-6.6/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-6.6/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-6.6/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> 34 extern int cpu_to_chip_id(int cpu); 44 void (*message_pass)(int cpu, int msg); 46 void (*cause_ipi)(int cpu); 48 int (*cause_nmi_ipi)(int cpu); 50 int (*kick_cpu)(int nr); 51 int (*prepare_cpu)(int nr); 52 void (*setup_cpu)(int nr); [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 …]
|