mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] IB/sa: replace GFP_KERNEL with GFP_ATOMIC
@ 2015-10-27 15:47 Saurabh Sengar
  2015-10-27 18:12 ` ira.weiny
  0 siblings, 1 reply; 10+ messages in thread
From: Saurabh Sengar @ 2015-10-27 15:47 UTC (permalink / raw)
  To: dledford, sean.hefty, hal.rosenstock, ira.weiny, jgunthorpe,
	yun.wang, kaike.wan, linux-rdma, linux-kernel
  Cc: Saurabh Sengar

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-11-13 12:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-27 15:47 [PATCH] IB/sa: replace GFP_KERNEL with GFP_ATOMIC Saurabh Sengar
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

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