4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 only,
8 * as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License version 2 for more details (a copy is included
14 * in the LICENSE file that accompanied this code).
19 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
20 * Copyright (c) 2012, Intel Corporation.
23 * This file is part of Lustre, http://www.lustre.org/
24 * Lustre is a trademark of Sun Microsystems, Inc.
26 * libcfs/include/libcfs/linux/linux-cpu.h
28 * Basic library routines.
30 * Author: liang@whamcloud.com
33 #ifndef __LIBCFS_LINUX_CPU_H__
34 #define __LIBCFS_LINUX_CPU_H__
36 #ifndef __LIBCFS_LIBCFS_H__
37 #error Do not #include this file directly. #include <linux/libcfs/libcfs.h> instead
40 #include <linux/cpu.h>
41 #include <linux/cpuset.h>
42 #include <linux/topology.h>
46 #define HAVE_LIBCFS_CPT
48 /** virtual processing unit */
49 struct cfs_cpu_partition {
50 /* CPUs mask for this partition */
51 cpumask_t *cpt_cpumask;
52 /* nodes mask for this partition */
53 nodemask_t *cpt_nodemask;
54 /* spread rotor for NUMA allocator */
55 unsigned int cpt_spread_rotor;
58 /** descriptor for CPU partitions */
59 struct cfs_cpt_table {
60 /* version, reserved for hotplug */
61 unsigned int ctb_version;
62 /* spread rotor for NUMA allocator */
63 unsigned int ctb_spread_rotor;
64 /* # of CPU partitions */
65 unsigned int ctb_nparts;
66 /* partitions tables */
67 struct cfs_cpu_partition *ctb_parts;
68 /* shadow HW CPU to CPU partition ID */
70 /* all cpus in this partition table */
71 cpumask_t *ctb_cpumask;
72 /* all nodes in this partition table */
73 nodemask_t *ctb_nodemask;
76 #endif /* CONFIG_SMP */
77 #endif /* __LIBCFS_LINUX_CPU_H__ */