aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hfi1/verbs.h
diff options
context:
space:
mode:
authorKaike Wan <kaike.wan@intel.com>2017-07-24 07:45:37 -0700
committerDoug Ledford <dledford@redhat.com>2017-07-31 15:17:54 -0400
commitbcad29137a9731bfa5e16d64bf8e8a71a268ac88 (patch)
treef7c1706567ae5e887a5046607a5e8d11f837ab24 /drivers/infiniband/hw/hfi1/verbs.h
parentIB/hfi1: Fix bar0 mapping to use write combining (diff)
downloadlinux-dev-bcad29137a9731bfa5e16d64bf8e8a71a268ac88.tar.xz
linux-dev-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/verbs.h')
-rw-r--r--drivers/infiniband/hw/hfi1/verbs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hfi1/verbs.h b/drivers/infiniband/hw/hfi1/verbs.h
index fdf1e1fb880c..34267c7ef85a 100644
--- a/drivers/infiniband/hw/hfi1/verbs.h
+++ b/drivers/infiniband/hw/hfi1/verbs.h
@@ -143,6 +143,7 @@ struct hfi1_pkt_state {
unsigned long timeout_int;
int cpu;
bool in_thread;
+ bool pkts_sent;
};
#define HFI1_PSN_CREDIT 16