Whamcloud - gitweb
LU-8703 libcfs: remove usless abstraction 48/25048/2
authorDmitry Eremin <dmitry.eremin@intel.com>
Tue, 24 Jan 2017 12:49:28 +0000 (15:49 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 23 Feb 2017 02:06:41 +0000 (02:06 +0000)
Remove aditional abstraction of cfs_cpu_ht_nsiblings().
Replace it with direct call to original function.

Change-Id: I63fa4a197519431dcf76c66cf22328e8b4410681
Test-Parameters: trivial
Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-on: https://review.whamcloud.com/25048
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Olaf Weber <olaf@sgi.com>
libcfs/include/libcfs/libcfs_cpu.h
libcfs/include/libcfs/linux/linux-cpu.h
libcfs/libcfs/libcfs_cpu.c
libcfs/libcfs/linux/linux-cpu.c
lustre/ptlrpc/service.c

index 3b459ab..07d53d0 100644 (file)
@@ -200,11 +200,6 @@ void cfs_cpt_unset_nodemask(struct cfs_cpt_table *cptab,
  */
 int cfs_cpt_spread_node(struct cfs_cpt_table *cptab, int cpt);
 
-/**
- * return number of HTs in the same core of \a cpu
- */
-int cfs_cpu_ht_nsiblings(int cpu);
-
 /*
  * allocate per-cpu-partition data, returned value is an array of pointers,
  * variable can be indexed by CPU ID.
index 36b763f..12cde1f 100644 (file)
@@ -89,7 +89,6 @@ struct cfs_cpt_table {
 };
 
 void cfs_cpu_core_siblings(int cpu, cpumask_t *mask);
-int cfs_cpu_ht_nsiblings(int cpu);
 
 #endif /* CONFIG_SMP */
 
index f36e2a3..b646875 100644 (file)
@@ -209,13 +209,6 @@ cfs_cpt_spread_node(struct cfs_cpt_table *cptab, int cpt)
 EXPORT_SYMBOL(cfs_cpt_spread_node);
 
 int
-cfs_cpu_ht_nsiblings(int cpu)
-{
-       return 1;
-}
-EXPORT_SYMBOL(cfs_cpu_ht_nsiblings);
-
-int
 cfs_cpt_current(struct cfs_cpt_table *cptab, int remap)
 {
        return 0;
index 069211a..63bec8c 100644 (file)
@@ -68,14 +68,6 @@ static char  *cpu_pattern = "N";
 module_param(cpu_pattern, charp, 0444);
 MODULE_PARM_DESC(cpu_pattern, "CPU partitions pattern");
 
-/* return number of HTs in the same core of \a cpu */
-int
-cfs_cpu_ht_nsiblings(int cpu)
-{
-       return cpumask_weight(topology_sibling_cpumask(cpu));
-}
-EXPORT_SYMBOL(cfs_cpu_ht_nsiblings);
-
 void
 cfs_cpt_table_free(struct cfs_cpt_table *cptab)
 {
index 4b57b9e..b0921ff 100644 (file)
@@ -559,7 +559,7 @@ ptlrpc_server_nthreads_check(struct ptlrpc_service *svc,
                 * have too many threads no matter how many cores/HTs
                 * there are.
                 */
-               if (cfs_cpu_ht_nsiblings(smp_processor_id()) > 1) {
+               if (cpumask_weight(topology_sibling_cpumask(smp_processor_id())) > 1) {
                        /* weight is # of HTs */
                        /* depress thread factor for hyper-thread */
                        factor = factor - (factor >> 1) + (factor >> 3);
@@ -2912,7 +2912,7 @@ int ptlrpc_hr_init(void)
 
        init_waitqueue_head(&ptlrpc_hr.hr_waitq);
 
-       weight = cfs_cpu_ht_nsiblings(smp_processor_id());
+       weight = cpumask_weight(topology_sibling_cpumask(smp_processor_id()));
 
        cfs_percpt_for_each(hrp, i, ptlrpc_hr.hr_partitions) {
                hrp->hrp_cpt = i;