• Chuck Lever's avatar
    svcrdma: Improve allocation of struct svc_rdma_op_ctxt · cc886c9f
    Chuck Lever authored
    When the maximum payload size of NFS READ and WRITE was increased
    by commit cc9a903d ("svcrdma: Change maximum server payload back
    to RPCSVC_MAXPAYLOAD"), the size of struct svc_rdma_op_ctxt
    increased to over 6KB (on x86_64). That makes allocating one of
    these from a kmem_cache more likely to fail in situations when
    system memory is exhausted.
    
    Since I'm about to add a caller where this allocation must always
    work _and_ it cannot sleep, pre-allocate ctxts for each connection.
    
    Another motivation for this change is that NFSv4.x servers are
    required by specification not to drop NFS requests. Pre-allocating
    memory resources reduces the likelihood of a drop.
    Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
    Acked-by: default avatarBruce Fields <bfields@fieldses.org>
    Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
    cc886c9f
svc_rdma.h 8.86 KB