提交 831464ce 编写于 作者: K Kaike Wan 提交者: Doug Ledford

IB/hfi1: Don't call cond_resched in atomic mode when sending packets

This patch fixed the problem where the driver might reschedule in atomic
mode when sending packets. This is due to the fact that the call to
cond_resched() in hfi1_do_send() might occur in atomic mode and a check is
required to avoid the warning message:
    "kernel: BUG: scheduling while atomic: swapper/2/0/0x10000100."
Reviewed-by: NDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: NMike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: NKaike Wan <kaike.wan@intel.com>
Signed-off-by: NJubin John <jubin.john@intel.com>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 528ee9fb
...@@ -906,8 +906,11 @@ void hfi1_do_send(struct rvt_qp *qp) ...@@ -906,8 +906,11 @@ void hfi1_do_send(struct rvt_qp *qp)
*ps.ppd->dd->send_schedule); *ps.ppd->dd->send_schedule);
return; return;
} }
cond_resched(); if (!irqs_disabled()) {
this_cpu_inc(*ps.ppd->dd->send_schedule); cond_resched();
this_cpu_inc(
*ps.ppd->dd->send_schedule);
}
timeout = jiffies + (timeout_int) / 8; timeout = jiffies + (timeout_int) / 8;
} }
spin_lock_irqsave(&qp->s_lock, flags); spin_lock_irqsave(&qp->s_lock, flags);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册