[ofa-general] [RFC][PATCH] release IPoIB-cm stale connections resouce
Shirley Ma
xma at us.ibm.com
Tue Jun 24 17:39:06 PDT 2008
Hello Roland,
This patch releases all staled connections, otherwise all statled connections
will remain untill the nodes down or IPoIB module being removed. It causes
waste lots of resource in the long run.
Signed-off-by: Shirley Ma <xma at us.ibm.com>
---------------------
drivers/infiniband/ulp/ipoib/ipoib_cm.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index ae67379..442dd49 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -61,6 +61,7 @@ MODULE_PARM_DESC(cm_data_debug_level,
#define IPOIB_CM_RX_UPDATE_TIME (256 * HZ)
#define IPOIB_CM_RX_TIMEOUT (2 * 256 * HZ)
+#define IPOIB_CM_RX_DRAIN (60 * HZ)
#define IPOIB_CM_RX_DELAY (3 * 256 * HZ)
#define IPOIB_CM_RX_UPDATE_MASK (0x3)
@@ -1343,6 +1344,15 @@ static void ipoib_cm_stale_task(struct work_struct *work)
int ret;
spin_lock_irq(&priv->lock);
+ /* wait for the CQ drain, and clean up stale connections */
+ while (!list_empty(&priv->cm.rx_error_list)) {
+ /* List is sorted by LRU, start from tail,
+ * stop when we see a recently used entry */
+ p = list_entry(priv->cm.rx_error_list.prev, typeof(*p), list);
+ if (time_before_eq(jiffies, p->jiffies + IPOIB_CM_RX_DRAIN))
+ break;
+ list_move(&p->list, &priv->cm.rx_reap_list);
+ }
while (!list_empty(&priv->cm.passive_ids)) {
/* List is sorted by LRU, start from tail,
* stop when we see a recently used entry */
(See attached file: stale_connection_cleanup.patch)
Thanks
Shirley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20080624/4b47fae1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stale_connection_cleanup.patch
Type: application/octet-stream
Size: 1528 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20080624/4b47fae1/attachment.obj>
More information about the general
mailing list