mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-22 05:01:27 +00:00
Disable preemption during tasklet schedule for per-CPU variable usage
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6206 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -73,9 +73,13 @@ EXPORT_SYMBOL_GPL(scst_post_alloc_data_buf);
|
||||
|
||||
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 @@ static inline void scst_schedule_tasklet(struct scst_cmd *cmd)
|
||||
wake_up(&cmd->cmd_threads->cmd_list_waitQ);
|
||||
spin_unlock_irqrestore(&cmd->cmd_threads->cmd_list_lock, flags);
|
||||
}
|
||||
|
||||
preempt_enable();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user