From: Hal Rosenstock <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
To: "linux-rdma
(linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)"
<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: Daniel Klein <danielk-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: [PATCH opensm] osm_opensm.c: Fix race condition between traps handling and SA shutdown
Date: Wed, 03 Jun 2015 11:56:30 -0400 [thread overview]
Message-ID: <556F23AE.9000608@dev.mellanox.co.il> (raw)
From: Daniel Klein <danielk-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Date: Mon, 11 May 2015 10:36:46 +0300
Bug description:
When OpenSM handles traps during SA shutdown, it might append these
traps to p_subn->rcvd_traps_list after the list is flushed.
As a result, the memory allocated for the list elements is not released.
With this change, during shutdown process OpenSM shuts down SM before
shutting down the SA, in order to avoid processing traps during SA
shutdown.
Signed-off-by: Daniel Klein <danielk-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
opensm/osm_opensm.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/opensm/osm_opensm.c b/opensm/osm_opensm.c
index a64a419..1d60e34 100644
--- a/opensm/osm_opensm.c
+++ b/opensm/osm_opensm.c
@@ -113,17 +113,17 @@ void osm_opensm_destroy(IN osm_opensm_t * p_osm)
osm_congestion_control_shutdown(&p_osm->cc);
- /* shut down the SA
- * - unbind from QP1 messages
- */
- osm_sa_shutdown(&p_osm->sa);
-
/* shut down the SM
* - make sure the SM sweeper thread exited
* - unbind from QP0 messages
*/
osm_sm_shutdown(&p_osm->sm);
+ /* shut down the SA
+ * - unbind from QP1 messages
+ */
+ osm_sa_shutdown(&p_osm->sa);
+
/* cleanup all messages on VL15 fifo that were not sent yet */
osm_vl15_shutdown(&p_osm->vl15, &p_osm->mad_pool);
--
1.7.8.2
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
reply other threads:[~2015-06-03 15:56 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=556F23AE.9000608@dev.mellanox.co.il \
--to=hal-ldsdmyg8hgv8yrgs2mwiifqbs+8scbdb@public.gmane.org \
--cc=danielk-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.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