Skip to content

Commit f631603

Browse files
Leon Romanovskyjgunthorpe
authored andcommitted
RDMA/core: Support object allocation in atomic context
AH objects are allocated in atomic context and those allocations should be done with GFP_ATOMIC. Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent feec576 commit f631603

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

include/rdma/ib_verbs.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@
5959
#include <linux/mmu_notifier.h>
6060
#include <linux/uaccess.h>
6161
#include <linux/cgroup_rdma.h>
62+
#include <linux/irqflags.h>
63+
#include <linux/preempt.h>
6264
#include <uapi/rdma/ib_user_verbs.h>
6365
#include <rdma/restrack.h>
6466
#include <uapi/rdma/rdma_user_ioctl.h>
@@ -2281,8 +2283,11 @@ struct uverbs_attr_bundle;
22812283
!__same_type(((struct drv_struct *)NULL)->member, \
22822284
struct ib_struct)))
22832285

2286+
#define rdma_zalloc_drv_obj_gfp(ib_dev, ib_type, gfp) \
2287+
((struct ib_type *)kzalloc(ib_dev->ops.size_##ib_type, gfp))
2288+
22842289
#define rdma_zalloc_drv_obj(ib_dev, ib_type) \
2285-
((struct ib_type *)kzalloc(ib_dev->ops.size_##ib_type, GFP_KERNEL))
2290+
rdma_zalloc_drv_obj_gfp(ib_dev, ib_type, GFP_KERNEL)
22862291

22872292
#define DECLARE_RDMA_OBJ_SIZE(ib_struct) size_t size_##ib_struct
22882293

0 commit comments

Comments
 (0)