diff options
author | Kaike Wan <kaike.wan@intel.com> | 2017-07-24 16:45:37 +0200 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-07-31 21:17:54 +0200 |
commit | bcad29137a9731bfa5e16d64bf8e8a71a268ac88 (patch) | |
tree | f7c1706567ae5e887a5046607a5e8d11f837ab24 /drivers/infiniband/hw/hfi1/vnic.h | |
parent | IB/hfi1: Fix bar0 mapping to use write combining (diff) | |
download | linux-bcad29137a9731bfa5e16d64bf8e8a71a268ac88.tar.xz linux-bcad29137a9731bfa5e16d64bf8e8a71a268ac88.zip |
IB/hfi1: Serve the most starved iowait entry first
When an egress resource(SDMA descriptors, pio credits) is not available,
a sending thread will be put on the resource's wait queue. When the
resource becomes available again, up to a fixed number of sending threads
can be awakened sequentially and removed from the wait queue, depending
on the number of waiting threads and the number of free resources. Since
each awakened sending thread will send as many packets as possible, it
is highly likely that the first sending thread will consume all the
egress resources. Subsequently, it will be put back to the end of the wait
queue. Depending on the timing when the later sending threads wake up,
they may not be able to send any packet and be again put back to the end
of the wait queue sequentially, right behind the first sending thread.
This starvation cycle continues until some sending threads exceed their
retry limit and consequently fail.
This patch fixes the issue by two simple approaches:
(1) Any starved sending thread will be put to the head of the wait queue
while a served sending thread will be put to the tail;
(2) The most starved sending thread will be served first.
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/hfi1/vnic.h')
-rw-r--r-- | drivers/infiniband/hw/hfi1/vnic.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hfi1/vnic.h b/drivers/infiniband/hw/hfi1/vnic.h index 4a621cde4abb..eec7c1424991 100644 --- a/drivers/infiniband/hw/hfi1/vnic.h +++ b/drivers/infiniband/hw/hfi1/vnic.h @@ -103,6 +103,7 @@ struct hfi1_vnic_sdma { struct sdma_txreq stx; unsigned int state; u8 q_idx; + bool pkts_sent; }; /** |