Whamcloud - gitweb
LU-3900 autoconf: use set_cpus_allowed_ptr for CPU_AFFINITY 82/7582/2
authorMinh Diep <minh.diep@intel.com>
Fri, 6 Sep 2013 23:38:12 +0000 (16:38 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 20 Sep 2013 20:50:53 +0000 (20:50 +0000)
Starting 2.6.32 kernel, set_cpus_allowed only set when
CONFIG_CPUMASK_OFFSTACK=n, so we will use set_cpus_allowed_ptr to
define CPU_AFFINITY

Signed-off-by: Minh Diep <minh.diep@intel.com>
Change-Id: I20d4bb2d620d877aadfb042757fd53cc122ee03a
Reviewed-on: http://review.whamcloud.com/7582
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
libcfs/include/libcfs/linux/linux-cpu.h
lnet/autoconf/lustre-lnet.m4

index f442f95..097a84b 100644 (file)
@@ -117,7 +117,6 @@ int cfs_cpu_ht_nsiblings(int cpu);
  * #define cfs_cpu_mask_first(mask)            first_cpu(mask)
  * #define cfs_cpu_mask_any_online(mask)      (any_online_cpu(mask) != NR_CPUS)
  * #define cfs_cpu_mask_for_each(i, mask)      for_each_cpu_mask(i, mask)
  * #define cfs_cpu_mask_first(mask)            first_cpu(mask)
  * #define cfs_cpu_mask_any_online(mask)      (any_online_cpu(mask) != NR_CPUS)
  * #define cfs_cpu_mask_for_each(i, mask)      for_each_cpu_mask(i, mask)
- * #define cfs_cpu_mask_bind(t, mask)          set_cpus_allowed(t, mask)
  *
  * #define cfs_cpu_mask_copy(dst, src)         cpumask_copy(dst, src)
  *
  *
  * #define cfs_cpu_mask_copy(dst, src)         cpumask_copy(dst, src)
  *
index 0a1232e..d38581c 100644 (file)
@@ -76,13 +76,13 @@ else
        LB_LINUX_TRY_COMPILE([
                #include <linux/sched.h>
        ],[
        LB_LINUX_TRY_COMPILE([
                #include <linux/sched.h>
        ],[
-               struct task_struct t;
+               struct task_struct *t;
                #if HAVE_CPUMASK_T
                cpumask_t     m;
                #else
                unsigned long m;
                #endif
                #if HAVE_CPUMASK_T
                cpumask_t     m;
                #else
                unsigned long m;
                #endif
-               set_cpus_allowed(&t, m);
+               set_cpus_allowed_ptr(t, &m);
        ],[
                AC_DEFINE(CPU_AFFINITY, 1, [kernel has cpu affinity support])
                AC_MSG_RESULT([yes])
        ],[
                AC_DEFINE(CPU_AFFINITY, 1, [kernel has cpu affinity support])
                AC_MSG_RESULT([yes])