This warning show up with kernels that enable preemptible
[ 1877.516799] BUG: using smp_processor_id() in preemptible [
00000000] code: mount.lustre/14077
Change it to disable preemption around smp_processor_id().
Linux-commit:
c369772e78a7383ba4e68673128fe2d6ef2863ee
Fixes:
ef94e4d1bb ("LU-8710 ptlrpc: use current CPU instead of hardcoded 0")
Change-Id: If66107f0843c5d0c4bcf874e64a20251fdf9704e
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/35495
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Shaun Tancheff <stancheff@cray.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Petros Koutoupis <pkoutoupis@cray.com>
Reviewed-by: Neil Brown <neilb@suse.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
* have too many threads no matter how many cores/HTs
* there are.
*/
+ preempt_disable();
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);
}
+ preempt_enable();
weight = cfs_cpt_weight(svc->srv_cptable, 0);
init_waitqueue_head(&ptlrpc_hr.hr_waitq);
+ preempt_disable();
weight = cpumask_weight(topology_sibling_cpumask(smp_processor_id()));
+ preempt_enable();
cfs_percpt_for_each(hrp, cpt, ptlrpc_hr.hr_partitions) {
hrp->hrp_cpt = cpt;