From: Hal Rosenstock <halr@voltaire.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, openib-general@openib.org
Subject: [PATCH 14/29v2] Optimize canceling a MAD
Date: 11 Jul 2005 16:20:05 -0400 [thread overview]
Message-ID: <1121110318.4389.5012.camel@hal.voltaire.com> (raw)
Optimize canceling a MAD.
- Eliminate searching timeout list in cancel case.
- Remove duplicate calls to queue work item.
- Eliminate resending a MAD before MAD is completed.
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Hal Rosenstock <halr@voltaire.com>
This patch depends on patch 13/29.
--
mad.c | 21 +++++++++++++--
1 files changed, 13 insertions(+), 8 deletions(-)
diff -uprN linux-2.6.13-rc2-mm1-13/drivers/infiniband/core/mad.c linux-2.6.13-rc2-mm1-14/drivers/infiniband/core/mad.c
-- linux-2.6.13-rc2-mm1-13/drivers/infiniband/core/mad.c 2005-07-11 13:38:30.000000000 -0400
+++ linux-2.6.13-rc2-mm1-14/drivers/infiniband/core/mad.c 2005-07-11 13:38:42.000000000 -0400
@@ -1754,14 +1754,18 @@ static void wait_for_response(struct ib_
delay = mad_send_wr->timeout;
mad_send_wr->timeout += jiffies;
- list_for_each_prev(list_item, &mad_agent_priv->wait_list) {
- temp_mad_send_wr = list_entry(list_item,
- struct ib_mad_send_wr_private,
- agent_list);
- if (time_after(mad_send_wr->timeout,
- temp_mad_send_wr->timeout))
- break;
+ if (delay) {
+ list_for_each_prev(list_item, &mad_agent_priv->wait_list) {
+ temp_mad_send_wr = list_entry(list_item,
+ struct ib_mad_send_wr_private,
+ agent_list);
+ if (time_after(mad_send_wr->timeout,
+ temp_mad_send_wr->timeout))
+ break;
+ }
}
+ else
+ list_item = &mad_agent_priv->wait_list;
list_add(&mad_send_wr->agent_list, list_item);
/* Reschedule a work item if we have a shorter timeout */
@@ -2197,7 +2201,8 @@ static void timeout_sends(void *data)
}
list_del(&mad_send_wr->agent_list);
- if (!retry_send(mad_send_wr))
+ if (mad_send_wr->status == IB_WC_SUCCESS &&
+ !retry_send(mad_send_wr))
continue;
spin_unlock_irqrestore(&mad_agent_priv->lock, flags);
reply other threads:[~2005-07-11 23:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1121110318.4389.5012.camel@hal.voltaire.com \
--to=halr@voltaire.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=openib-general@openib.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome