X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;ds=sidebyside;f=libcfs%2Finclude%2Flibcfs%2Flinux%2Flinux-cpu.h;h=8353f69eb3feac805a9c8ec5b28bb2ed16f551f2;hb=77f5bb4dace53e0040dea4ce5c72156e901e6819;hp=12cde1f715451f926c97b85e4003fd2ad9329c0b;hpb=40fe3cd7283dfd1cee5f989483c517601ac773f8;p=fs%2Flustre-release.git diff --git a/libcfs/include/libcfs/linux/linux-cpu.h b/libcfs/include/libcfs/linux/linux-cpu.h index 12cde1f..8353f69 100644 --- a/libcfs/include/libcfs/linux/linux-cpu.h +++ b/libcfs/include/libcfs/linux/linux-cpu.h @@ -23,7 +23,7 @@ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * - * Copyright (c) 2012, 2013, Intel Corporation. + * Copyright (c) 2012, 2017, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -39,61 +39,15 @@ #ifndef __LIBCFS_LINUX_CPU_H__ #define __LIBCFS_LINUX_CPU_H__ -#ifndef __LIBCFS_LIBCFS_H__ -#error Do not #include this file directly. #include instead -#endif - -#ifndef __KERNEL__ -#error This include is only for kernel use. -#endif - #include -#include -#include -#include - -#ifdef CONFIG_SMP - -#define HAVE_LIBCFS_CPT - -/** virtual processing unit */ -struct cfs_cpu_partition { - /* CPUs mask for this partition */ - cpumask_t *cpt_cpumask; - /* nodes mask for this partition */ - nodemask_t *cpt_nodemask; - /* NUMA distance between CPTs */ - unsigned *cpt_distance; - /* spread rotor for NUMA allocator */ - unsigned cpt_spread_rotor; -}; - -/** descriptor for CPU partitions */ -struct cfs_cpt_table { - /* spread rotor for NUMA allocator */ - unsigned ctb_spread_rotor; - /* maximum NUMA distance between all nodes in table */ - unsigned ctb_distance; - /* # of CPU partitions */ - unsigned ctb_nparts; - /* partitions tables */ - struct cfs_cpu_partition *ctb_parts; - /* shadow HW CPU to CPU partition ID */ - int *ctb_cpu2cpt; - /* all cpus in this partition table */ - cpumask_t *ctb_cpumask; - /* shadow HW node to CPU partition ID */ - int *ctb_node2cpt; - /* all nodes in this partition table */ - nodemask_t *ctb_nodemask; -}; - -void cfs_cpu_core_siblings(int cpu, cpumask_t *mask); - -#endif /* CONFIG_SMP */ #ifndef HAVE_TOPOLOGY_SIBLING_CPUMASK # define topology_sibling_cpumask(cpu) topology_thread_cpumask(cpu) #endif /* HAVE_TOPOLOGY_SIBLING_CPUMASK */ +#ifndef HAVE_CPUS_READ_LOCK +# define cpus_read_lock get_online_cpus +# define cpus_read_unlock put_online_cpus +#endif + #endif /* __LIBCFS_LINUX_CPU_H__ */