> On Nov 24, 2015, at 1:55 AM, Christoph Hellwig <h...@infradead.org> wrote:
> 
>> +struct svc_rdma_op_ctxt *svc_rdma_get_context_gfp(struct svcxprt_rdma *xprt,
>> +                                              gfp_t flags)
>> +{
>> +    struct svc_rdma_op_ctxt *ctxt;
>> +
>> +    ctxt = kmem_cache_alloc(svc_rdma_ctxt_cachep, flags);
>> +    if (!ctxt)
>> +            return NULL;
>> +    svc_rdma_init_context(xprt, ctxt);
>> +    return ctxt;
>> +}
>> +
>> +struct svc_rdma_op_ctxt *svc_rdma_get_context(struct svcxprt_rdma *xprt)
>> +{
>> +    struct svc_rdma_op_ctxt *ctxt;
>> +
>> +    ctxt = kmem_cache_alloc(svc_rdma_ctxt_cachep,
>> +                            GFP_KERNEL | __GFP_NOFAIL);
>> +    svc_rdma_init_context(xprt, ctxt);
>>      return ctxt;
> 
> Sounds like you should have just added a gfp_t argument to
> svc_rdma_get_context.

There is only one (new) call site that needs it. I can simplify
this patch as Sagi suggested before, but it seems silly to
introduce the extra clutter of adding a gfp_t argument
everywhere.


> And if we have any way to avoid the __GFP_NOFAIL
> I'd really appreciate if we could give that a try.

I’m not introducing the flag here.

Changing all the svc_rdma_get_context() call sites to handle
allocation failure (when it is already highly unlikely) is
a lot of needless work, IMO, and not related to supporting
bi-directional RPC.

--
Chuck Lever




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

Reply via email to