Re: [PATCH v3 4/4] svcrdma: Use contiguous pages for RDMA Read sink buffers

Christoph Hellwig
2026-03-17T14:29:00Z

On Fri, Mar 13, 2026 at 03:42:01PM -0400, Chuck Lever wrote:
> Suggested-by: Christoph Hellwig <hch@infradead.org>

I think that's a bit too much credit. I just wondered why sunrpc can't
coalesce pages itself.

> +#if PAGE_SIZE < SZ_64K
> +
> +/*
> + * Limit contiguous RDMA Read sink allocations to 64KB
> + * (order-4 on 4KB-page systems). Higher orders risk
> + * allocation failure under __GFP_NORETRY, which would
> + * negate the benefit of the contiguous fast path.
> + */
> +#define SVC_RDMA_CONTIG_MAX_ORDER get_order(SZ_64K)

Isn't the limit really an order and thus grows with the page size,
instead of based on a fixed size?

> + o = get_order(nr_pages << PAGE_SHIFT);
> + if (o > SVC_RDMA_CONTIG_MAX_ORDER)
> + o = SVC_RDMA_CONTIG_MAX_ORDER;

Use min()?