diff mbox

[-next] IB/ipath: use GFP_ATOMIC under spin lock

Message ID CAPgLHd-jM-DN1VjvwUh=-s0jLOyqijdn2xHzXhdoxRs0UTGtNg@mail.gmail.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Wei Yongjun Feb. 20, 2013, 10:10 a.m. UTC
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

A spin lock is taken here so we should use GFP_ATOMIC.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/infiniband/hw/ipath/ipath_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Marciniszyn, Mike Feb. 20, 2013, 2:42 p.m. UTC | #1
> -	ret = idr_alloc(&unit_table, dd, 0, 0, GFP_KERNEL);
> +	ret = idr_alloc(&unit_table, dd, 0, 0, GFP_ATOMIC);

GFP_NOWAIT seems to match other use cases introduced by commit cf1f5bb608af6e0d57610c2740a3f69e3568eee3.

Is that what should be used?

Mike
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tejun Heo Feb. 20, 2013, 3:54 p.m. UTC | #2
On Wed, Feb 20, 2013 at 02:42:28PM +0000, Marciniszyn, Mike wrote:
> > -	ret = idr_alloc(&unit_table, dd, 0, 0, GFP_KERNEL);
> > +	ret = idr_alloc(&unit_table, dd, 0, 0, GFP_ATOMIC);
> 
> GFP_NOWAIT seems to match other use cases introduced by commit cf1f5bb608af6e0d57610c2740a3f69e3568eee3.
> 
> Is that what should be used?

Yes, it should have been GFP_NOWAIT.  Sorry about that.

Thanks.
diff mbox

Patch

diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c
index fcdaeea..03ed479 100644
--- a/drivers/infiniband/hw/ipath/ipath_driver.c
+++ b/drivers/infiniband/hw/ipath/ipath_driver.c
@@ -204,7 +204,7 @@  static struct ipath_devdata *ipath_alloc_devdata(struct pci_dev *pdev)
 	idr_preload(GFP_KERNEL);
 	spin_lock_irqsave(&ipath_devs_lock, flags);
 
-	ret = idr_alloc(&unit_table, dd, 0, 0, GFP_KERNEL);
+	ret = idr_alloc(&unit_table, dd, 0, 0, GFP_ATOMIC);
 	if (ret < 0) {
 		printk(KERN_ERR IPATH_DRV_NAME
 		       ": Could not allocate unit ID: error %d\n", -ret);