From: Oleg Drokin Date: Fri, 27 Feb 2015 07:57:07 +0000 (-0500) Subject: LU-6285 libcfs: Do not unnecessarily copy cpumask X-Git-Tag: 2.7.52~19 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=b4f41e5fef3ff644f9adb95921329ef59e1e3e74 LU-6285 libcfs: Do not unnecessarily copy cpumask Copying a mask just to calculate a static value of siblings is overkill, esp. if CPUMASK_OFFSTACK is set and the mask is huge, additionally that'll workaround the incorrectness of kernel code dealing with such a code until that is actually fixed upstream. Change-Id: I860cc7d5b54adcde2e7622bfbc64b4e27046b083 Signed-off-by: Oleg Drokin Reviewed-on: http://review.whamcloud.com/13904 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Liang Zhen Reviewed-by: James Simmons Reviewed-by: Dmitry Eremin --- diff --git a/libcfs/libcfs/linux/linux-cpu.c b/libcfs/libcfs/linux/linux-cpu.c index e55678e..6e879d4 100644 --- a/libcfs/libcfs/linux/linux-cpu.c +++ b/libcfs/libcfs/linux/linux-cpu.c @@ -118,12 +118,7 @@ cfs_cpu_ht_nsiblings(int cpu) { int num; - mutex_lock(&cpt_data.cpt_mutex); - - cfs_cpu_ht_siblings(cpu, cpt_data.cpt_cpumask); - num = cpus_weight(*cpt_data.cpt_cpumask); - - mutex_unlock(&cpt_data.cpt_mutex); + num = cpus_weight(*topology_thread_cpumask(cpu)); return num; }