From: Saurabh Sengar <saurabh.truth@gmail.com>
To: dledford@redhat.com, sean.hefty@intel.com,
hal.rosenstock@gmail.com, ira.weiny@intel.com,
jgunthorpe@obsidianresearch.com, yun.wang@profitbricks.com,
kaike.wan@intel.com, linux-rdma@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: Saurabh Sengar <saurabh.truth@gmail.com>
Subject: [PATCH] IB/sa: replace GFP_KERNEL with GFP_ATOMIC
Date: Tue, 27 Oct 2015 21:17:40 +0530 [thread overview]
Message-ID: <1445960860-3396-1-git-send-email-saurabh.truth@gmail.com> (raw)
In-Reply-To: <saurabh.truth@gmail.com>
replace GFP_KERNEL with GFP_ATOMIC, as code while holding a spinlock
should be atomic
GFP_KERNEL may sleep and can cause deadlock, where as GFP_ATOMIC may
fail but certainly avoids deadlock
Signed-off-by: Saurabh Sengar <saurabh.truth@gmail.com>
---
drivers/infiniband/core/sa_query.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c
index 8c014b3..cd1f911 100644
--- a/drivers/infiniband/core/sa_query.c
+++ b/drivers/infiniband/core/sa_query.c
@@ -526,7 +526,7 @@ static int ib_nl_send_msg(struct ib_sa_query *query)
if (len <= 0)
return -EMSGSIZE;
- skb = nlmsg_new(len, GFP_KERNEL);
+ skb = nlmsg_new(len, GFP_ATOMIC);
if (!skb)
return -ENOMEM;
@@ -544,7 +544,7 @@ static int ib_nl_send_msg(struct ib_sa_query *query)
/* Repair the nlmsg header length */
nlmsg_end(skb, nlh);
- ret = ibnl_multicast(skb, nlh, RDMA_NL_GROUP_LS, GFP_KERNEL);
+ ret = ibnl_multicast(skb, nlh, RDMA_NL_GROUP_LS, GFP_ATOMIC);
if (!ret)
ret = len;
else
--
1.9.1
next reply other threads:[~2015-10-27 15:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-27 15:47 Saurabh Sengar [this message]
2015-10-27 18:12 ` ira.weiny
2015-10-27 18:16 ` Jason Gunthorpe
2015-10-27 18:20 ` ira.weiny
2015-10-27 18:56 ` Wan, Kaike
2015-10-27 20:00 ` Jason Gunthorpe
2015-10-28 4:30 ` Weiny, Ira
2015-11-13 7:42 ` Saurabh Sengar
2015-11-13 10:47 ` Wan, Kaike
2015-11-13 12:37 ` Saurabh Sengar
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=1445960860-3396-1-git-send-email-saurabh.truth@gmail.com \
--to=saurabh.truth@gmail.com \
--cc=dledford@redhat.com \
--cc=hal.rosenstock@gmail.com \
--cc=ira.weiny@intel.com \
--cc=jgunthorpe@obsidianresearch.com \
--cc=kaike.wan@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=sean.hefty@intel.com \
--cc=yun.wang@profitbricks.com \
/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