summaryrefslogtreecommitdiffstats
path: root/net/rds/rds.h
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2010-04-15 16:38:14 -0400
committerAndy Grover <andy.grover@oracle.com>2010-09-08 18:12:24 -0700
commit9e29db0e3645cafa980e68a9c717a761448389e1 (patch)
tree4ce87432acbda8e16c27c97f3d1ae5339bb53559 /net/rds/rds.h
parentacfcd4d4ec4ed8cb504f96d4fabb7a94029b362b (diff)
downloadop-kernel-dev-9e29db0e3645cafa980e68a9c717a761448389e1.zip
op-kernel-dev-9e29db0e3645cafa980e68a9c717a761448389e1.tar.gz
RDS: Use a generation counter to avoid rds_send_xmit loop
rds_send_xmit is required to loop around after it releases the lock because someone else could done a trylock, found someone working on the list and backed off. But, once we drop our lock, it is possible that someone else does come in and make progress on the list. We should detect this and not loop around if another process is actually working on the list. This patch adds a generation counter that is bumped every time we get the lock and do some send work. If the retry notices someone else has bumped the generation counter, it does not need to loop around and continue working. Signed-off-by: Chris Mason <chris.mason@oracle.com> Signed-off-by: Andy Grover <andy.grover@oracle.com>
Diffstat (limited to 'net/rds/rds.h')
-rw-r--r--net/rds/rds.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/rds/rds.h b/net/rds/rds.h
index 2f19d49..b57cb50 100644
--- a/net/rds/rds.h
+++ b/net/rds/rds.h
@@ -92,6 +92,7 @@ struct rds_connection {
struct rds_cong_map *c_fcong;
spinlock_t c_send_lock; /* protect send ring */
+ atomic_t c_send_generation;
struct rds_message *c_xmit_rm;
unsigned long c_xmit_sg;
unsigned int c_xmit_hdr_off;
OpenPOWER on IntegriCloud