/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
*
- * Copyright (c) 2012, 2014, Intel Corporation.
+ * Copyright (c) 2012, 2015, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
* >1 : specify number of partitions
*/
static int cpu_npartitions;
-CFS_MODULE_PARM(cpu_npartitions, "i", int, 0444, "# of CPU partitions");
+module_param(cpu_npartitions, int, 0444);
+MODULE_PARM_DESC(cpu_npartitions, "# of CPU partitions");
/**
* modparam for setting CPU partitions patterns:
* NB: If user specified cpu_pattern, cpu_npartitions will be ignored
*/
static char *cpu_pattern = "";
-CFS_MODULE_PARM(cpu_pattern, "s", charp, 0444, "CPU partitions pattern");
+module_param(cpu_pattern, charp, 0444);
+MODULE_PARM_DESC(cpu_pattern, "CPU partitions pattern");
struct cfs_cpt_data {
/* serialize hotplug etc */
static struct cfs_cpt_data cpt_data;
-void
-cfs_cpu_core_siblings(int cpu, cpumask_t *mask)
-{
- /* return cpumask of cores in the same socket */
- cpumask_copy(mask, topology_core_cpumask(cpu));
-}
-EXPORT_SYMBOL(cfs_cpu_core_siblings);
-
/* return number of cores in the same socket of \a cpu */
int
cfs_cpu_core_nsiblings(int cpu)
mutex_lock(&cpt_data.cpt_mutex);
- cfs_cpu_core_siblings(cpu, cpt_data.cpt_cpumask);
+ cpumask_copy(cpt_data.cpt_cpumask, topology_core_cpumask(cpu));
num = cpumask_weight(cpt_data.cpt_cpumask);
mutex_unlock(&cpt_data.cpt_mutex);
return num;
}
-EXPORT_SYMBOL(cfs_cpu_core_nsiblings);
/* return cpumask of HTs in the same core */
void
cfs_cpu_ht_siblings(int cpu, cpumask_t *mask)
{
- cpumask_copy(mask, topology_thread_cpumask(cpu));
+ cpumask_copy(mask, topology_sibling_cpumask(cpu));
}
-EXPORT_SYMBOL(cfs_cpu_ht_siblings);
/* return number of HTs in the same core of \a cpu */
int
{
int num;
- num = cpumask_weight(topology_thread_cpumask(cpu));
+ num = cpumask_weight(topology_sibling_cpumask(cpu));
return num;
}
else
cpumask_clear(mask);
}
-EXPORT_SYMBOL(cfs_node_to_cpumask);
void
cfs_cpt_table_free(struct cfs_cpt_table *cptab)
cpu = cpumask_first(node);
/* get cpumask for cores in the same socket */
- cfs_cpu_core_siblings(cpu, socket);
+ cpumask_copy(socket, topology_core_cpumask(cpu));
cpumask_and(socket, socket, node);
LASSERT(!cpumask_empty(socket));
int i;
/* get cpumask for hts in the same core */
- cfs_cpu_ht_siblings(cpu, core);
+ cpumask_copy(core, topology_sibling_cpumask(cpu));
cpumask_and(core, core, node);
LASSERT(!cpumask_empty(core));
mutex_lock(&cpt_data.cpt_mutex);
/* if all HTs in a core are offline, it may break affinity */
- cfs_cpu_ht_siblings(cpu, cpt_data.cpt_cpumask);
+ cpumask_copy(cpt_data.cpt_cpumask,
+ topology_sibling_cpumask(cpu));
warn = cpumask_any_and(cpt_data.cpt_cpumask,
cpu_online_mask) >= nr_cpu_ids;
mutex_unlock(&cpt_data.cpt_mutex);