Skip to content

Commit 8b3ac9f

Browse files
bcodding-rhchucklever
authored andcommitted
SUNRPC: Cleanup/fix initial rq_pages allocation
While investigating some reports of memory-constrained NUMA machines failing to mount v3 and v4.0 nfs mounts, we found that svc_init_buffer() was not attempting to retry allocations from the bulk page allocator. Typically, this results in a single page allocation being returned and the mount attempt fails with -ENOMEM. A retry would have allowed the mount to succeed. Additionally, it seems that the bulk allocation in svc_init_buffer() is redundant because svc_alloc_arg() will perform the required allocation and does the correct thing to retry the allocations. The call to allocate memory in svc_alloc_arg() drops the preferred node argument, but I expect we'll still allocate on the preferred node because the allocation call happens within the svc thread context, which chooses the node with memory closest to the current thread's execution. This patch cleans out the bulk allocation in svc_init_buffer() to allow svc_alloc_arg() to handle the allocation/retry logic for rq_pages. Signed-off-by: Benjamin Coddington <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Fixes: ed603bc ("sunrpc: Replace the rq_pages array with dynamically-allocated memory") Signed-off-by: Chuck Lever <[email protected]>
1 parent 32ce6b3 commit 8b3ac9f

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

net/sunrpc/svc.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -638,8 +638,6 @@ EXPORT_SYMBOL_GPL(svc_destroy);
638638
static bool
639639
svc_init_buffer(struct svc_rqst *rqstp, const struct svc_serv *serv, int node)
640640
{
641-
unsigned long ret;
642-
643641
rqstp->rq_maxpages = svc_serv_maxpages(serv);
644642

645643
/* rq_pages' last entry is NULL for historical reasons. */
@@ -649,9 +647,7 @@ svc_init_buffer(struct svc_rqst *rqstp, const struct svc_serv *serv, int node)
649647
if (!rqstp->rq_pages)
650648
return false;
651649

652-
ret = alloc_pages_bulk_node(GFP_KERNEL, node, rqstp->rq_maxpages,
653-
rqstp->rq_pages);
654-
return ret == rqstp->rq_maxpages;
650+
return true;
655651
}
656652

657653
/*

0 commit comments

Comments
 (0)