alistair23-linux/net/rds
Zach Brown 0f4b1c7e89 rds: fix rds_send_xmit() serialization
rds_send_xmit() was changed to hold an interrupt masking spinlock instead of a
mutex so that it could be called from the IB receive tasklet path.  This broke
the TCP transport because its xmit method can block and masks and unmasks
interrupts.

This patch serializes callers to rds_send_xmit() with a simple bit instead of
the current spinlock or previous mutex.  This enables rds_send_xmit() to be
called from any context and to call functions which block.  Getting rid of the
c_send_lock exposes the bare c_lock acquisitions which are changed to block
interrupts.

A waitqueue is added so that rds_conn_shutdown() can wait for callers to leave
rds_send_xmit() before tearing down partial send state.  This lets us get rid
of c_senders.

rds_send_xmit() is changed to check the conn state after acquiring the
RDS_IN_XMIT bit to resolve races with the shutdown path.  Previously both
worked with the conn state and then the lock in the same order, allowing them
to race and execute the paths concurrently.

rds_send_reset() isn't racing with rds_send_xmit() now that rds_conn_shutdown()
properly ensures that rds_send_xmit() can't start once the conn state has been
changed.  We can remove its previous use of the spinlock.

Finally, c_send_generation is redundant.  Callers can race to test the c_flags
bit by simply retrying instead of racing to test the c_send_generation atomic.

Signed-off-by: Zach Brown <zach.brown@oracle.com>
2010-09-08 18:15:27 -07:00
..
af_rds.c rds: Use RCU for the bind lookup searches 2010-09-08 18:15:08 -07:00
bind.c rds: Use RCU for the bind lookup searches 2010-09-08 18:15:08 -07:00
cong.c RDS: Bypass workqueue when queueing cong updates 2010-09-08 18:12:16 -07:00
connection.c rds: fix rds_send_xmit() serialization 2010-09-08 18:15:27 -07:00
ib.c RDS/IB: disconnect when IB devices are removed 2010-09-08 18:15:19 -07:00
ib.h RDS/IB: Add caching of frags and incs 2010-09-08 18:15:23 -07:00
ib_cm.c RDS/IB: Add caching of frags and incs 2010-09-08 18:15:23 -07:00
ib_rdma.c RDS/IB: add refcount tracking to struct rds_ib_device 2010-09-08 18:15:17 -07:00
ib_recv.c RDS: use friendly gfp masks for prefill 2010-09-08 18:15:24 -07:00
ib_ring.c
ib_send.c rds: fix rds_send_xmit() serialization 2010-09-08 18:15:27 -07:00
ib_stats.c RDS: Move atomic stats from general to ib-specific area 2010-09-08 18:12:20 -07:00
ib_sysctl.c RDS: Remove unsignaled_bytes sysctl 2010-09-08 18:11:52 -07:00
info.c RDS: cleanup: remove "== NULL"s and "!= NULL"s in ptr comparisons 2010-09-08 18:11:32 -07:00
info.h
iw.c RDS: Stop supporting old cong map sending method 2010-09-08 18:12:10 -07:00
iw.h RDS: Remove struct rds_rdma_op 2010-09-08 18:11:58 -07:00
iw_cm.c RDS: cleanup: remove "== NULL"s and "!= NULL"s in ptr comparisons 2010-09-08 18:11:32 -07:00
iw_rdma.c RDS: fold rdma.h into rds.h 2010-09-08 18:11:37 -07:00
iw_recv.c RDS: inc_purge() transport function unused - remove it 2010-09-08 18:11:46 -07:00
iw_ring.c
iw_send.c RDS: Rename data op members prefix from m_ to op_ 2010-09-08 18:11:59 -07:00
iw_stats.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu 2009-09-15 09:39:44 -07:00
iw_sysctl.c RDS: cleanup: remove "== NULL"s and "!= NULL"s in ptr comparisons 2010-09-08 18:11:32 -07:00
Kconfig RDS: Modularize RDMA and TCP transports 2009-08-23 19:13:09 -07:00
loop.c RDS: Stop supporting old cong map sending method 2010-09-08 18:12:10 -07:00
loop.h
Makefile RDS: Modularize RDMA and TCP transports 2009-08-23 19:13:09 -07:00
message.c rds: don't let RDS shutdown a connection while senders are present 2010-09-08 18:15:09 -07:00
page.c RDS: Use page_remainder_alloc() for recv bufs 2010-09-08 18:15:20 -07:00
rdma.c RDS: Add flag for silent ops. Do atomic op before RDMA 2010-09-08 18:12:06 -07:00
rdma_transport.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2010-04-27 12:49:13 -07:00
rdma_transport.h
rds.h rds: fix rds_send_xmit() serialization 2010-09-08 18:15:27 -07:00
recv.c RDS: Whitespace 2010-09-08 18:11:44 -07:00
send.c rds: fix rds_send_xmit() serialization 2010-09-08 18:15:27 -07:00
stats.c RDS: Move atomic stats from general to ib-specific area 2010-09-08 18:12:20 -07:00
sysctl.c RDS: cleanup: remove "== NULL"s and "!= NULL"s in ptr comparisons 2010-09-08 18:11:32 -07:00
tcp.c RDS: Stop supporting old cong map sending method 2010-09-08 18:12:10 -07:00
tcp.h RDS: Stop supporting old cong map sending method 2010-09-08 18:12:10 -07:00
tcp_connect.c RDS: cleanup: remove "== NULL"s and "!= NULL"s in ptr comparisons 2010-09-08 18:11:32 -07:00
tcp_listen.c RDS: cleanup: remove "== NULL"s and "!= NULL"s in ptr comparisons 2010-09-08 18:11:32 -07:00
tcp_recv.c RDS: inc_purge() transport function unused - remove it 2010-09-08 18:11:46 -07:00
tcp_send.c RDS: Stop supporting old cong map sending method 2010-09-08 18:12:10 -07:00
tcp_stats.c
threads.c rds: fix rds_send_xmit() serialization 2010-09-08 18:15:27 -07:00
transport.c RDS: Track transports via an array, not a list 2009-08-23 19:13:12 -07:00