Whamcloud - gitweb
LU-4199 libcfs: Handle nodemask on UMP machines 19/9219/3
authorJames Simmons <uja.ornl@gmail.com>
Thu, 13 Feb 2014 01:06:40 +0000 (20:06 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 1 Mar 2014 02:32:57 +0000 (02:32 +0000)
For UMP and SMP machines the struct cfs_cpt_table are
defined differently. In the case handled by this patch
nodemask is defined as a integer for the UMP case and
as a pointer for the SMP case. This will cause a problem
for ost_setup which reads the nodemask directly. Instead
we create a UMP version of cfs_cpt_nodemask and use that
in ost_setup.

Change-Id: I0dd80f79cf4589fc98182786d3f970432388f1fe
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Reviewed-on: http://review.whamcloud.com/9219
Tested-by: Jenkins
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Li Xi <pkuelelixi@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
libcfs/libcfs/libcfs_cpu.c
lustre/ost/ost_handler.c

index 775af69..87dec68 100644 (file)
@@ -58,6 +58,7 @@ cfs_cpt_table_alloc(unsigned int ncpt)
        LIBCFS_ALLOC(cptab, sizeof(*cptab));
        if (cptab != NULL) {
                cptab->ctb_version = CFS_CPU_VERSION_MAGIC;
        LIBCFS_ALLOC(cptab, sizeof(*cptab));
        if (cptab != NULL) {
                cptab->ctb_version = CFS_CPU_VERSION_MAGIC;
+               set_bit(0, &cptab->ctb_nodemask);
                cptab->ctb_nparts  = ncpt;
        }
 
                cptab->ctb_nparts  = ncpt;
        }
 
@@ -95,6 +96,13 @@ cfs_cpt_online(struct cfs_cpt_table *cptab, int cpt)
 }
 EXPORT_SYMBOL(cfs_cpt_online);
 
 }
 EXPORT_SYMBOL(cfs_cpt_online);
 
+nodemask_t *
+cfs_cpt_nodemask(struct cfs_cpt_table *cptab, int cpt)
+{
+       return &cptab->ctb_nodemask;
+}
+EXPORT_SYMBOL(cfs_cpt_cpumask);
+
 int
 cfs_cpt_set_cpu(struct cfs_cpt_table *cptab, int cpt, int cpu)
 {
 int
 cfs_cpt_set_cpu(struct cfs_cpt_table *cptab, int cpt, int cpu)
 {
index a39381f..e14c61a 100644 (file)
@@ -175,7 +175,7 @@ static int ost_setup(struct obd_device *obd, struct lustre_cfg* lcfg)
                GOTO(out_service, rc);
         }
 
                GOTO(out_service, rc);
         }
 
-       mask = cfs_cpt_table->ctb_nodemask;
+       mask = cfs_cpt_nodemask(cfs_cpt_table, CFS_CPT_ANY);
        /* event CPT feature is disabled in libcfs level by set partition
         * number to 1, we still want to set node affinity for io service */
        if (cfs_cpt_number(cfs_cpt_table) == 1 && nodes_weight(*mask) > 1) {
        /* event CPT feature is disabled in libcfs level by set partition
         * number to 1, we still want to set node affinity for io service */
        if (cfs_cpt_number(cfs_cpt_table) == 1 && nodes_weight(*mask) > 1) {