Commit c83188dc authored by Chris Mason's avatar Chris Mason Committed by Andy Grover

rds: per-rm flush_wait waitq

This removes a global waitqueue used to wait for rds messages
and replaces it with a waitqueue inside the rds_message struct.

The global waitqueue turns into a global lock and significantly
bottlenecks operations on large machines.
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 976673ee
...@@ -35,8 +35,6 @@ ...@@ -35,8 +35,6 @@
#include "rds.h" #include "rds.h"
static DECLARE_WAIT_QUEUE_HEAD(rds_message_flush_waitq);
static unsigned int rds_exthdr_size[__RDS_EXTHDR_MAX] = { static unsigned int rds_exthdr_size[__RDS_EXTHDR_MAX] = {
[RDS_EXTHDR_NONE] = 0, [RDS_EXTHDR_NONE] = 0,
[RDS_EXTHDR_VERSION] = sizeof(struct rds_ext_header_version), [RDS_EXTHDR_VERSION] = sizeof(struct rds_ext_header_version),
...@@ -226,6 +224,7 @@ struct rds_message *rds_message_alloc(unsigned int extra_len, gfp_t gfp) ...@@ -226,6 +224,7 @@ struct rds_message *rds_message_alloc(unsigned int extra_len, gfp_t gfp)
INIT_LIST_HEAD(&rm->m_sock_item); INIT_LIST_HEAD(&rm->m_sock_item);
INIT_LIST_HEAD(&rm->m_conn_item); INIT_LIST_HEAD(&rm->m_conn_item);
spin_lock_init(&rm->m_rs_lock); spin_lock_init(&rm->m_rs_lock);
init_waitqueue_head(&rm->m_flush_wait);
out: out:
return rm; return rm;
...@@ -399,14 +398,14 @@ int rds_message_inc_copy_to_user(struct rds_incoming *inc, ...@@ -399,14 +398,14 @@ int rds_message_inc_copy_to_user(struct rds_incoming *inc,
*/ */
void rds_message_wait(struct rds_message *rm) void rds_message_wait(struct rds_message *rm)
{ {
wait_event_interruptible(rds_message_flush_waitq, wait_event_interruptible(rm->m_flush_wait,
!test_bit(RDS_MSG_MAPPED, &rm->m_flags)); !test_bit(RDS_MSG_MAPPED, &rm->m_flags));
} }
void rds_message_unmapped(struct rds_message *rm) void rds_message_unmapped(struct rds_message *rm)
{ {
clear_bit(RDS_MSG_MAPPED, &rm->m_flags); clear_bit(RDS_MSG_MAPPED, &rm->m_flags);
wake_up_interruptible(&rds_message_flush_waitq); wake_up_interruptible(&rm->m_flush_wait);
} }
EXPORT_SYMBOL_GPL(rds_message_unmapped); EXPORT_SYMBOL_GPL(rds_message_unmapped);
...@@ -301,6 +301,8 @@ struct rds_message { ...@@ -301,6 +301,8 @@ struct rds_message {
* -> rs->rs_lock * -> rs->rs_lock
*/ */
spinlock_t m_rs_lock; spinlock_t m_rs_lock;
wait_queue_head_t m_flush_wait;
struct rds_sock *m_rs; struct rds_sock *m_rs;
/* cookie to send to remote, in rds header */ /* cookie to send to remote, in rds header */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment