Whamcloud - gitweb
LU-2800 autoconf: remove obsolete autoconf options
[fs/lustre-release.git] / libcfs / libcfs / linux / linux-cpu.c
index 57cf5c7..99327ba 100644 (file)
@@ -22,7 +22,7 @@
  */
 /*
  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, 2012, Whamcloud, Inc.
+ * Copyright (c) 2012, 2013, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -55,7 +55,7 @@ CFS_MODULE_PARM(cpu_npartitions, "i", int, 0444, "# of CPU partitions");
  * 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
@@ -79,7 +79,7 @@ static struct cfs_cpt_data    cpt_data;
 void
 cfs_cpu_core_siblings(int cpu, cpumask_t *mask)
 {
-#if defined(HAVE_TOPOLOGY_CORE_CPUMASK)
+#if defined(HAVE_TOPOLOGY_CORE_CPUMASK) && defined(HAVE_CPUMASK_COPY)
        /* return cpumask of cores in the same socket */
        cpumask_copy(mask, topology_core_cpumask(cpu));
 #elif defined(HAVE_TOPOLOGY_CORE_SIBLINGS)
@@ -112,7 +112,7 @@ EXPORT_SYMBOL(cfs_cpu_core_nsiblings);
 void
 cfs_cpu_ht_siblings(int cpu, cpumask_t *mask)
 {
-#if defined(HAVE_TOPOLOGY_THREAD_CPUMASK)
+#if defined(HAVE_TOPOLOGY_THREAD_CPUMASK) && defined(HAVE_CPUMASK_COPY)
        cpumask_copy(mask, topology_thread_cpumask(cpu));
 #elif defined(HAVE_TOPOLOGY_THREAD_SIBLINGS)
        *mask = topology_thread_siblings(cpu);
@@ -143,7 +143,7 @@ EXPORT_SYMBOL(cfs_cpu_ht_nsiblings);
 void
 cfs_node_to_cpumask(int node, cpumask_t *mask)
 {
-#if defined(HAVE_CPUMASK_OF_NODE)
+#if defined(HAVE_CPUMASK_OF_NODE) && defined(HAVE_CPUMASK_COPY)
        cpumask_copy(mask, cpumask_of_node(node));
 #elif defined(HAVE_NODE_TO_CPUMASK)
        *mask = node_to_cpumask(node);
@@ -656,16 +656,14 @@ cfs_cpt_bind(struct cfs_cpt_table *cptab, int cpt)
 #else
                rc = set_cpus_allowed_ptr(cfs_current(), cpumask);
 #endif
-#ifdef HAVE_SET_MEMS_ALLOWED
                set_mems_allowed(*nodemask);
-#endif
                if (rc == 0)
                        cfs_schedule(); /* switch to allowed CPU */
 
                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);