aboutsummaryrefslogtreecommitdiff
path: root/module/icp/core/kcf_sched.c
diff options
context:
space:
mode:
authorMorgan Jones <mjones@rice.edu>2017-06-19 16:43:16 +0000
committerBrian Behlendorf <behlendorf1@llnl.gov>2017-06-19 16:43:16 +0000
commitd9ad3fea3bd0368b6af0b08ccc4de1b080e2bcb7 (patch)
tree8275909a37a01b0fa87f5ad906fb9950bc14fc3d /module/icp/core/kcf_sched.c
parent0241e491a08ffa471a08ceaa0b0943999d775cbe (diff)
downloadsrc-d9ad3fea3bd0368b6af0b08ccc4de1b080e2bcb7.tar.gz
src-d9ad3fea3bd0368b6af0b08ccc4de1b080e2bcb7.zip
Add kpreempt_disable/enable around CPU_SEQID uses
In zfs/dmu_object and icp/core/kcf_sched, the CPU_SEQID macro should be surrounded by `kpreempt_disable` and `kpreempt_enable` calls to avoid a Linux kernel BUG warning. These code paths use the cpuid to minimize lock contention and is is safe to reschedule the process to a different processor at any time. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Morgan Jones <me@numin.it> Closes #6239
Diffstat (limited to 'module/icp/core/kcf_sched.c')
-rw-r--r--module/icp/core/kcf_sched.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/module/icp/core/kcf_sched.c b/module/icp/core/kcf_sched.c
index f9bcfe094e6b..da2346f7ec21 100644
--- a/module/icp/core/kcf_sched.c
+++ b/module/icp/core/kcf_sched.c
@@ -1306,8 +1306,11 @@ kcf_reqid_insert(kcf_areq_node_t *areq)
int indx;
crypto_req_id_t id;
kcf_areq_node_t *headp;
- kcf_reqid_table_t *rt =
- kcf_reqid_table[CPU_SEQID & REQID_TABLE_MASK];
+ kcf_reqid_table_t *rt;
+
+ kpreempt_disable();
+ rt = kcf_reqid_table[CPU_SEQID & REQID_TABLE_MASK];
+ kpreempt_enable();
mutex_enter(&rt->rt_lock);