* cpu_npartitions=1:
* core[0, 1, ... 7] = partition[0]
*
- * . User can also specifiy CPU partitions by string pattern
+ * . User can also specify CPU partitions by string pattern
*
* Examples: cpu_partitions="0[0,1], 1[2,3]"
* cpu_partitions="N 0[0-3], 1[4-8]"
*
- * The first charactor "N" means following numbers are numa ID
+ * The first character "N" means following numbers are numa ID
*
* . NUMA allocators, CPU affinity threads are built over CPU partitions,
* instead of HW CPUs or HW nodes.
* configured by cpu_npartitions of the global cfs_cpt_table
*
* . If cpu_npartitions=1(all CPUs in one pool), lustre should work the
- * same way as 2.2 or earlier verison
+ * same way as 2.2 or earlier versions
*
* Author: liang@whamcloud.com
*/
#include <libcfs/libcfs.h>
-/** Global cpu partition table */
+/** Global CPU partition table */
struct cfs_cpt_table *cfs_cpt_table __read_mostly = NULL;
EXPORT_SYMBOL(cfs_cpt_table);
{
return 1;
}
-EXPORT_SYMBOL(cfs_cpt_number);
+EXPORT_SYMBOL(cfs_cpt_weight);
int
cfs_cpt_online(struct cfs_cpt_table *cptab, int cpt)
{
return 0;
}
-EXPORT_SYMBOL(cfs_cpt_from_cpu);
+EXPORT_SYMBOL(cfs_cpt_of_cpu);
int
cfs_cpt_bind(struct cfs_cpt_table *cptab, int cpt)
* i.e: "0[0,1,2,3] 1[4,5,6,7]", number before bracket is CPU partition ID,
* number in bracket is processor ID (core or HT)
*
- * i.e: "N 0[0,1] 1[2,3]" the first character 'n' means numbers in bracket
+ * i.e: "N 0[0,1] 1[2,3]" the first character 'N' means numbers in bracket
* are NUMA node ID, number before bracket is CPU partition ID.
*
* NB: If user specified cpu_pattern, cpu_npartitions will be ignored
return rc;
}
- /* don't need to set affinity baecause all online CPUs are covered */
+ /* don't need to set affinity because all online CPUs are covered */
return 0;
}
EXPORT_SYMBOL(cfs_cpt_bind);
the_lnet.ln_remote_nets_hash = NULL;
}
+static void
+lnet_destroy_locks(void)
+{
+ if (the_lnet.ln_res_lock != NULL) {
+ cfs_percpt_lock_free(the_lnet.ln_res_lock);
+ the_lnet.ln_res_lock = NULL;
+ }
+
+ if (the_lnet.ln_net_lock != NULL) {
+ cfs_percpt_lock_free(the_lnet.ln_net_lock);
+ the_lnet.ln_net_lock = NULL;
+ }
+
+ lnet_fini_locks();
+}
+
static int
lnet_create_locks(void)
{
return 0;
failed:
- lnet_fini_locks();
+ lnet_destroy_locks();
return -ENOMEM;
}
-static void
-lnet_destroy_locks(void)
-{
- if (the_lnet.ln_res_lock != NULL) {
- cfs_percpt_lock_free(the_lnet.ln_res_lock);
- the_lnet.ln_res_lock = NULL;
- }
-
- if (the_lnet.ln_net_lock != NULL) {
- cfs_percpt_lock_free(the_lnet.ln_net_lock);
- the_lnet.ln_net_lock = NULL;
- }
-
- lnet_fini_locks();
-}
-
void lnet_assert_wire_constants (void)
{
/* Wire protocol assertions generated by 'wirecheck'