提交 cecd8d81 编写于 作者: P Prasad Kanneganti 提交者: David S. Miller

liquidio: avoid doing useless work

Avoid doing useless work by making sure that the response_list is not empty
before scheduling work to process it.
Signed-off-by: NPrasad Kanneganti <prasad.kanneganti@cavium.com>
Signed-off-by: NFelix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 fcbedd0f
...@@ -366,6 +366,7 @@ int ...@@ -366,6 +366,7 @@ int
lio_process_iq_request_list(struct octeon_device *oct, lio_process_iq_request_list(struct octeon_device *oct,
struct octeon_instr_queue *iq, u32 napi_budget) struct octeon_instr_queue *iq, u32 napi_budget)
{ {
struct cavium_wq *cwq = &oct->dma_comp_wq;
int reqtype; int reqtype;
void *buf; void *buf;
u32 old = iq->flush_index; u32 old = iq->flush_index;
...@@ -450,6 +451,10 @@ lio_process_iq_request_list(struct octeon_device *oct, ...@@ -450,6 +451,10 @@ lio_process_iq_request_list(struct octeon_device *oct,
bytes_compl); bytes_compl);
iq->flush_index = old; iq->flush_index = old;
if (atomic_read(&oct->response_list
[OCTEON_ORDERED_SC_LIST].pending_req_count))
queue_delayed_work(cwq->wq, &cwq->wk.work, msecs_to_jiffies(1));
return inst_count; return inst_count;
} }
......
...@@ -49,7 +49,6 @@ int octeon_setup_response_list(struct octeon_device *oct) ...@@ -49,7 +49,6 @@ int octeon_setup_response_list(struct octeon_device *oct)
INIT_DELAYED_WORK(&cwq->wk.work, oct_poll_req_completion); INIT_DELAYED_WORK(&cwq->wk.work, oct_poll_req_completion);
cwq->wk.ctxptr = oct; cwq->wk.ctxptr = oct;
oct->cmd_resp_state = OCT_DRV_ONLINE; oct->cmd_resp_state = OCT_DRV_ONLINE;
queue_delayed_work(cwq->wq, &cwq->wk.work, msecs_to_jiffies(50));
return ret; return ret;
} }
...@@ -164,5 +163,8 @@ static void oct_poll_req_completion(struct work_struct *work) ...@@ -164,5 +163,8 @@ static void oct_poll_req_completion(struct work_struct *work)
struct cavium_wq *cwq = &oct->dma_comp_wq; struct cavium_wq *cwq = &oct->dma_comp_wq;
lio_process_ordered_list(oct, 0); lio_process_ordered_list(oct, 0);
queue_delayed_work(cwq->wq, &cwq->wk.work, msecs_to_jiffies(50));
if (atomic_read(&oct->response_list
[OCTEON_ORDERED_SC_LIST].pending_req_count))
queue_delayed_work(cwq->wq, &cwq->wk.work, msecs_to_jiffies(1));
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册