Lines Matching +full:active +full:- +full:distance

1 // SPDX-License-Identifier: GPL-2.0-or-later
9 /* Enables debugging of low-level hash table routines - careful! */
14 #include <linux/dma-mapping.h>
36 #include <asm/papr-sysparm.h>
94 if (pp->dispatch_log) in alloc_dtl_buffers()
106 pp->dtl_ridx = 0; in alloc_dtl_buffers()
107 pp->dispatch_log = dtl; in alloc_dtl_buffers()
108 pp->dispatch_log_end = dtl + N_DISPATCH_LOG; in alloc_dtl_buffers()
109 pp->dtl_curr = dtl; in alloc_dtl_buffers()
126 dtl = pp->dispatch_log; in register_dtl_buffer()
128 pp->dtl_ridx = 0; in register_dtl_buffer()
129 pp->dtl_curr = dtl; in register_dtl_buffer()
133 dtl->enqueue_to_dispatch_time = cpu_to_be32(DISPATCH_LOG_BYTES); in register_dtl_buffer()
192 if (!pp->dispatch_log) in free_dtl_buffers()
194 kmem_cache_free(dtl_cache, pp->dispatch_log); in free_dtl_buffers()
195 pp->dtl_ridx = 0; in free_dtl_buffers()
196 pp->dispatch_log = NULL; in free_dtl_buffers()
197 pp->dispatch_log_end = NULL; in free_dtl_buffers()
198 pp->dtl_curr = NULL; in free_dtl_buffers()
217 return -ENOMEM; in init_cpu_associativity()
260 return -EINVAL; in cpu_relative_dispatch_distance()
266 return -EIO; in cpu_relative_dispatch_distance()
279 return -EINVAL; in cpu_home_node_dispatch_distance()
286 return -EIO; in cpu_home_node_dispatch_distance()
294 int distance; in update_vcpu_disp_stat() local
297 if (disp->last_disp_cpu == -1) { in update_vcpu_disp_stat()
298 disp->last_disp_cpu = disp_cpu; in update_vcpu_disp_stat()
302 disp->total_disp++; in update_vcpu_disp_stat()
304 if (disp->last_disp_cpu == disp_cpu || in update_vcpu_disp_stat()
305 (cpu_first_thread_sibling(disp->last_disp_cpu) == in update_vcpu_disp_stat()
307 disp->same_cpu_disp++; in update_vcpu_disp_stat()
309 distance = cpu_relative_dispatch_distance(disp->last_disp_cpu, in update_vcpu_disp_stat()
311 if (distance < 0) in update_vcpu_disp_stat()
315 switch (distance) { in update_vcpu_disp_stat()
317 disp->same_chip_disp++; in update_vcpu_disp_stat()
320 disp->diff_chip_disp++; in update_vcpu_disp_stat()
323 disp->far_chip_disp++; in update_vcpu_disp_stat()
326 …pr_debug_ratelimited("vcpudispatch_stats: cpu %d (%d -> %d): unexpected relative dispatch distance in update_vcpu_disp_stat()
328 disp->last_disp_cpu, in update_vcpu_disp_stat()
330 distance); in update_vcpu_disp_stat()
335 distance = cpu_home_node_dispatch_distance(disp_cpu); in update_vcpu_disp_stat()
336 if (distance < 0) in update_vcpu_disp_stat()
340 switch (distance) { in update_vcpu_disp_stat()
342 disp->numa_home_disp++; in update_vcpu_disp_stat()
345 disp->numa_remote_disp++; in update_vcpu_disp_stat()
348 disp->numa_far_disp++; in update_vcpu_disp_stat()
351 pr_debug_ratelimited("vcpudispatch_stats: cpu %d on %d: unexpected numa dispatch distance %d\n", in update_vcpu_disp_stat()
354 distance); in update_vcpu_disp_stat()
358 disp->last_disp_cpu = disp_cpu; in update_vcpu_disp_stat()
365 struct dtl_entry *dtl = local_paca->dispatch_log + (i % N_DISPATCH_LOG); in process_dtl_buffer()
366 struct dtl_entry *dtl_end = local_paca->dispatch_log_end; in process_dtl_buffer()
367 struct lppaca *vpa = local_paca->lppaca_ptr; in process_dtl_buffer()
370 if (!local_paca->dispatch_log) in process_dtl_buffer()
374 if (d->cpu != smp_processor_id()) { in process_dtl_buffer()
375 pr_debug("vcpudispatch_stats: cpu %d worker migrated -- canceling worker\n", in process_dtl_buffer()
380 if (i == be64_to_cpu(vpa->dtl_idx)) in process_dtl_buffer()
383 while (i < be64_to_cpu(vpa->dtl_idx)) { in process_dtl_buffer()
386 if (i + N_DISPATCH_LOG < be64_to_cpu(vpa->dtl_idx)) { in process_dtl_buffer()
389 d->cpu, in process_dtl_buffer()
390 be64_to_cpu(vpa->dtl_idx) - N_DISPATCH_LOG - i); in process_dtl_buffer()
391 i = be64_to_cpu(vpa->dtl_idx) - N_DISPATCH_LOG; in process_dtl_buffer()
392 dtl = local_paca->dispatch_log + (i % N_DISPATCH_LOG); in process_dtl_buffer()
399 dtl = local_paca->dispatch_log; in process_dtl_buffer()
405 schedule_delayed_work_on(d->cpu, to_delayed_work(work), in process_dtl_buffer()
414 INIT_DELAYED_WORK(&d->work, process_dtl_buffer); in dtl_worker_online()
415 d->cpu = cpu; in dtl_worker_online()
424 schedule_delayed_work_on(cpu, &d->work, HZ / vcpudispatch_stats_freq); in dtl_worker_online()
432 cancel_delayed_work_sync(&d->work); in dtl_worker_offline()
468 rc = -EBUSY; in dtl_worker_enable()
484 rc = -EINVAL; in dtl_worker_enable()
510 return -EINVAL; in vcpudispatch_stats_write()
513 return -EFAULT; in vcpudispatch_stats_write()
519 return rc ? rc : -EINVAL; in vcpudispatch_stats_write()
538 disp->last_disp_cpu = -1; in vcpudispatch_stats_write()
573 seq_put_decimal_ull(p, " ", disp->total_disp); in vcpudispatch_stats_display()
574 seq_put_decimal_ull(p, " ", disp->same_cpu_disp); in vcpudispatch_stats_display()
575 seq_put_decimal_ull(p, " ", disp->same_chip_disp); in vcpudispatch_stats_display()
576 seq_put_decimal_ull(p, " ", disp->diff_chip_disp); in vcpudispatch_stats_display()
577 seq_put_decimal_ull(p, " ", disp->far_chip_disp); in vcpudispatch_stats_display()
578 seq_put_decimal_ull(p, " ", disp->numa_home_disp); in vcpudispatch_stats_display()
579 seq_put_decimal_ull(p, " ", disp->numa_remote_disp); in vcpudispatch_stats_display()
580 seq_put_decimal_ull(p, " ", disp->numa_far_disp); in vcpudispatch_stats_display()
607 return -EINVAL; in vcpudispatch_stats_freq_write()
610 return -EFAULT; in vcpudispatch_stats_freq_write()
617 return rc ? rc : -EINVAL; in vcpudispatch_stats_freq_write()
670 return tb_to_ns(be64_to_cpu(READ_ONCE(lppaca->enqueue_dispatch_tb)) + in pseries_paravirt_steal_clock()
671 be64_to_cpu(READ_ONCE(lppaca->ready_enqueue_tb))); in pseries_paravirt_steal_clock()
706 * PAPR says this feature is SLB-Buffer but firmware never in vpa_init()
710 addr = __pa(paca_ptrs[cpu]->slb_shadow_ptr); in vpa_init()
781 /* I-cache Invalidate = 0 */ in pSeries_lpar_hpte_insert()
782 /* I-cache synchronize = 0 */ in pSeries_lpar_hpte_insert()
792 return -1; in pSeries_lpar_hpte_insert()
798 * or we will loop forever, so return -2 in this case. in pSeries_lpar_hpte_insert()
802 return -2; in pSeries_lpar_hpte_insert()
805 pr_devel(" -> slot: %lu\n", slot & 7); in pSeries_lpar_hpte_insert()
844 return -1; in pSeries_lpar_hpte_remove()
949 return -1; in pSeries_lpar_hpte_updatepp()
984 return -1; in __pSeries_lpar_hpte_find()
1008 return -1; in pSeries_lpar_hpte_find()
1024 BUG_ON(slot == -1); in pSeries_lpar_hpte_updateboltedpp()
1109 param[1], param[2], param[3], param[4], /* TS0-7 */ in call_block_remove()
1117 for (i = 0; i < idx-1; i++) { in call_block_remove()
1133 if (new_idx && (retry_busy || new_idx == (PLPAR_HCALL9_BUFSIZE-1))) { in call_block_remove()
1162 vpgb = (vpn[i] >> (shift - VPN_SHIFT + 3)); in hugepage_block_invalidate()
1262 max_hpte_count = 1U << (PMD_SHIFT - shift); in pSeries_lpar_hugepage_invalidate()
1282 if (index == PPC64_HUGE_HPTE_BATCH - 1) { in pSeries_lpar_hugepage_invalidate()
1318 if (slot == -1) in pSeries_lpar_hpte_removebolted()
1319 return -ENOENT; in pSeries_lpar_hpte_removebolted()
1359 psize = batch->psize; in do_block_remove()
1360 ssize = batch->ssize; in do_block_remove()
1363 vpn = batch->vpn[i]; in do_block_remove()
1364 pte = batch->pte[i]; in do_block_remove()
1370 vpgb = (vpn >> (shift - VPN_SHIFT + 3)); in do_block_remove()
1414 * The ibm,get-system-parameter properties is returning a buffer with the
1418 * -----------------
1427 * -----------------
1429 * -----------------
1442 * - bit 7 is the L bit
1443 * - bits 0-5 are the penc value
1465 if (def->penc[psize] == lp) { in check_lp_set_hblkrm()
1510 npsize > 0 && idx < len; npsize--) in pseries_lpar_read_hblkrm_characteristics()
1541 if (is_supported_hlbkrm(batch->psize, batch->psize)) { in pSeries_lpar_flush_hash_range()
1546 psize = batch->psize; in pSeries_lpar_flush_hash_range()
1547 ssize = batch->ssize; in pSeries_lpar_flush_hash_range()
1550 vpn = batch->vpn[i]; in pSeries_lpar_flush_hash_range()
1551 pte = batch->pte[i]; in pSeries_lpar_flush_hash_range()
1612 state->commit_rc = plpar_resize_hpt_commit(0, state->shift); in pseries_lpar_resize_hpt_commit()
1613 if (state->commit_rc != H_SUCCESS) in pseries_lpar_resize_hpt_commit()
1614 return -EIO; in pseries_lpar_resize_hpt_commit()
1617 ppc64_pft_size = state->shift; in pseries_lpar_resize_hpt_commit()
1619 htab_hash_mask = (htab_size_bytes >> 7) - 1; in pseries_lpar_resize_hpt_commit()
1641 return -ENODEV; in pseries_lpar_resize_hpt()
1652 /* prepare with shift==0 cancels an in-progress resize */ in pseries_lpar_resize_hpt()
1657 return -ETIMEDOUT; in pseries_lpar_resize_hpt()
1670 return -EINVAL; in pseries_lpar_resize_hpt()
1673 return -EPERM; in pseries_lpar_resize_hpt()
1676 return -EIO; in pseries_lpar_resize_hpt()
1689 return -ENOSPC; in pseries_lpar_resize_hpt()
1694 return -EIO; in pseries_lpar_resize_hpt()
1735 0, PRTB_SIZE_SHIFT - 12); in radix_init_pseries()
1749 pr_info("%s: CMO free page hinting is not active.\n", __func__); in cmo_free_hint()
1755 pr_info("%s: CMO free page hinting is active.\n", __func__); in cmo_free_hint()
1826 hcall_tracepoint_refcount--; in hcall_tracepoint_unregfunc()
1834 * been invoked from a non-hcall, so the first hcall could recurse into it
1858 (*depth)--; in __trace_hcall_entry()
1879 (*depth)--; in __trace_hcall_exit()
1897 mpp_data->entitled_mem = retbuf[0]; in h_get_mpp()
1898 mpp_data->mapped_mem = retbuf[1]; in h_get_mpp()
1900 mpp_data->group_num = (retbuf[2] >> 2 * 8) & 0xffff; in h_get_mpp()
1901 mpp_data->pool_num = retbuf[2] & 0xffff; in h_get_mpp()
1903 mpp_data->mem_weight = (retbuf[3] >> 7 * 8) & 0xff; in h_get_mpp()
1904 mpp_data->unallocated_mem_weight = (retbuf[3] >> 6 * 8) & 0xff; in h_get_mpp()
1905 mpp_data->unallocated_entitlement = retbuf[3] & 0xffffffffffffUL; in h_get_mpp()
1907 mpp_data->pool_size = retbuf[4]; in h_get_mpp()
1908 mpp_data->loan_request = retbuf[5]; in h_get_mpp()
1909 mpp_data->backing_mem = retbuf[6]; in h_get_mpp()
1922 mpp_x_data->coalesced_bytes = retbuf[0]; in h_get_mpp_x()
1923 mpp_x_data->pool_coalesced_bytes = retbuf[1]; in h_get_mpp_x()
1924 mpp_x_data->pool_purr_cycles = retbuf[2]; in h_get_mpp_x()
1925 mpp_x_data->pool_spurr_cycles = retbuf[3]; in h_get_mpp_x()
1943 vsid_modulus = ((1UL << (va_bits - SID_SHIFT)) - 1); in vsid_unscramble()
1946 vsid_modulus = ((1UL << (va_bits - SID_SHIFT_1T)) - 1); in vsid_unscramble()
1982 * the addresses in "ibm,adjunct-virtual-addresses" because we don't in reserve_vrma_context_id()
1983 * enable adjunct support via the "ibm,client-architecture-support" in reserve_vrma_context_id()
1998 int cpu = (long)filp->private_data; in vpa_file_read()
2022 /* set up the per-cpu vpa file*/ in vpa_debugfs_init()
2024 sprintf(name, "cpu-%ld", i); in vpa_debugfs_init()