On 26-Mar-19 16:56, Leon Romanovsky wrote: > From: Leon Romanovsky <leonro@xxxxxxxxxxxx> > > Hi, > > This is continuation of our conversion from driver allocations to core > responsibility. Current series converts SRQ and AH, while latter > required some code preparation. > > The most challenge was in supporting AH to be allocated with GFP_ATOMIC > or GFP_KERNEL according to context. The common solution is to use in_atomic() > and in_interrupt() already used in many drivers, but unfortunately > checkpatch produces warning. > > WARNING: use of in_atomic() is incorrect outside core kernel code > #37: FILE: include/rdma/ib_verbs.h:2288: > + (in_atomic() || in_interrupt()) ? GFP_ATOMIC : GFP_KERNEL)) Hi Leon, The existing method to test for create AH atomic flow is using the flags parameters (RDMA_CREATE_AH_SLEEPABLE). I suggest you add a gfp_flags parameter to rdma_zalloc_drv_obj() and pass GFP_ATOMIC in case RDMA_CREATE_AH_SLEEPABLE flag is set.