|
From: <vl...@us...> - 2015-05-09 03:17:18
|
Revision: 6206
http://sourceforge.net/p/scst/svn/6206
Author: vlnb
Date: 2015-05-09 03:17:16 +0000 (Sat, 09 May 2015)
Log Message:
-----------
Disable preemption during tasklet schedule for per-CPU variable usage
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2015-05-09 03:16:19 UTC (rev 6205)
+++ trunk/scst/src/scst_targ.c 2015-05-09 03:17:16 UTC (rev 6206)
@@ -73,9 +73,13 @@
static inline void scst_schedule_tasklet(struct scst_cmd *cmd)
{
- struct scst_percpu_info *i = &scst_percpu_infos[smp_processor_id()];
+ struct scst_percpu_info *i;
unsigned long flags;
+ preempt_disable();
+
+ i = &scst_percpu_infos[smp_processor_id()];
+
if (atomic_read(&i->cpu_cmd_count) <= scst_max_tasklet_cmd) {
spin_lock_irqsave(&i->tasklet_lock, flags);
TRACE_DBG("Adding cmd %p to tasklet %d cmd list", cmd,
@@ -93,6 +97,8 @@
wake_up(&cmd->cmd_threads->cmd_list_waitQ);
spin_unlock_irqrestore(&cmd->cmd_threads->cmd_list_lock, flags);
}
+
+ preempt_enable();
return;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|