diff options
author | Chris Mason <chris.mason@oracle.com> | 2010-04-21 16:09:28 -0400 |
---|---|---|
committer | Andy Grover <andy.grover@oracle.com> | 2010-09-08 21:12:27 -0400 |
commit | c83188dcd76b1f0c17c31b4bbd8de57c634b19f8 (patch) | |
tree | 1d66c7996693e36d88f9fa7bebcb28281612675d /net/rds/message.c | |
parent | 976673ee1b92d939168c8c1fbad3e16c45caa545 (diff) |
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: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'net/rds/message.c')
-rw-r--r-- | net/rds/message.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/net/rds/message.c b/net/rds/message.c index 4cb1ed704153..96e2bf7dc77e 100644 --- a/net/rds/message.c +++ b/net/rds/message.c | |||
@@ -35,8 +35,6 @@ | |||
35 | 35 | ||
36 | #include "rds.h" | 36 | #include "rds.h" |
37 | 37 | ||
38 | static DECLARE_WAIT_QUEUE_HEAD(rds_message_flush_waitq); | ||
39 | |||
40 | static unsigned int rds_exthdr_size[__RDS_EXTHDR_MAX] = { | 38 | static unsigned int rds_exthdr_size[__RDS_EXTHDR_MAX] = { |
41 | [RDS_EXTHDR_NONE] = 0, | 39 | [RDS_EXTHDR_NONE] = 0, |
42 | [RDS_EXTHDR_VERSION] = sizeof(struct rds_ext_header_version), | 40 | [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 | INIT_LIST_HEAD(&rm->m_sock_item); | 224 | INIT_LIST_HEAD(&rm->m_sock_item); |
227 | INIT_LIST_HEAD(&rm->m_conn_item); | 225 | INIT_LIST_HEAD(&rm->m_conn_item); |
228 | spin_lock_init(&rm->m_rs_lock); | 226 | spin_lock_init(&rm->m_rs_lock); |
227 | init_waitqueue_head(&rm->m_flush_wait); | ||
229 | 228 | ||
230 | out: | 229 | out: |
231 | return rm; | 230 | return rm; |
@@ -399,14 +398,14 @@ int rds_message_inc_copy_to_user(struct rds_incoming *inc, | |||
399 | */ | 398 | */ |
400 | void rds_message_wait(struct rds_message *rm) | 399 | void rds_message_wait(struct rds_message *rm) |
401 | { | 400 | { |
402 | wait_event_interruptible(rds_message_flush_waitq, | 401 | wait_event_interruptible(rm->m_flush_wait, |
403 | !test_bit(RDS_MSG_MAPPED, &rm->m_flags)); | 402 | !test_bit(RDS_MSG_MAPPED, &rm->m_flags)); |
404 | } | 403 | } |
405 | 404 | ||
406 | void rds_message_unmapped(struct rds_message *rm) | 405 | void rds_message_unmapped(struct rds_message *rm) |
407 | { | 406 | { |
408 | clear_bit(RDS_MSG_MAPPED, &rm->m_flags); | 407 | clear_bit(RDS_MSG_MAPPED, &rm->m_flags); |
409 | wake_up_interruptible(&rds_message_flush_waitq); | 408 | wake_up_interruptible(&rm->m_flush_wait); |
410 | } | 409 | } |
411 | EXPORT_SYMBOL_GPL(rds_message_unmapped); | 410 | EXPORT_SYMBOL_GPL(rds_message_unmapped); |
412 | 411 | ||