Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DEA2F54706C; Thu, 17 Sep 2026 19:02:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789671768; cv=none; b=nl6jcuTIrux/5RhuK7mPqM/nBmURyh28Jxxxypyg7viqwFj5+ZyZj7DVOpQFfX8CU4p7VqMTvZ16F2r2DFE8UsqynqoSQ1thWI/niMwB03dvEA8k42Li1yuKBnWHj1cuE9ipqRQ8kE3Id/zNPgWesULPuEUapSpMwWw4fc1ed/k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789671768; c=relaxed/simple; bh=EjiTTGYYApAmT4GlqvRSqc3yDyJKQWNRSZJr2GSeqY8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JBN+A1rpH41aJWkByEjeyhDmVqbmt4E97VZsnpB2b4kxdeUpKCYJ0SrGMx3MbgkMyKD4rO0snQuyDwU0ZyUJivCTBe5bc/FV5oi9GrET/6MzMGMMRVNlx3n3ZGRcpbpw7BaH43BehkSjoJTqYuDEyg2aX+dtqyN68gM7PjHmvEs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SfbqcKMh; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="SfbqcKMh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8C861F000FF; Thu, 17 Sep 2026 19:02:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789671766; bh=f5VJS49VzOvtUV3uDlCUcMGj7sKm2zSXXGPXzBQD9O0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=SfbqcKMh2qV5byQyXYxtdYTS9BBNluR+uF2RKjEUDGcuB6LvYuO0oe1VDg3QbIBRV Wn4tpYMYdOJEe2LZJyBHX3Jt39zzgMvid9Cx6XrtGew4hA8k7NTgceyV+BUMjLDeMo r28X1lLz5V3TBj/wLhKZ0XjsOXUCJgCVZs7ar3Cs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Anna Schumaker , Sasha Levin Subject: [PATCH 6.12 1082/1102] SUNRPC: Update svcxdr_init_decode() to call xdr_set_scratch_folio() Date: Thu, 17 Sep 2026 16:17:05 +0100 Message-ID: <20260917151608.011588018@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260917151539.408551884@linuxfoundation.org> References: <20260917151539.408551884@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Anna Schumaker [ Upstream commit d57e43b72bf2071caac90da323849c3983a695f0 ] The only snag here is that __folio_alloc_node() doesn't handle NUMA_NO_NODE, so I also need to update svc_pool_map_get_node() to return numa_mem_id() instead. I arrived at this approach by looking at what other users of __folio_alloc_node() do for this case. Signed-off-by: Anna Schumaker Stable-dep-of: c479bde671cb ("sunrpc: defer rq_argp and rq_resp free until after RCU grace period") Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- include/linux/sunrpc/svc.h | 4 ++-- net/sunrpc/svc.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h @@ -190,7 +190,7 @@ struct svc_rqst { struct xdr_buf rq_arg; struct xdr_stream rq_arg_stream; struct xdr_stream rq_res_stream; - struct page *rq_scratch_page; + struct folio *rq_scratch_folio; struct xdr_buf rq_res; struct page *rq_pages[RPCSVC_MAXPAGES + 1]; struct page * *rq_respages; /* points into rq_pages */ @@ -504,7 +504,7 @@ static inline void svcxdr_init_decode(st buf->len = buf->head->iov_len + buf->page_len + buf->tail->iov_len; xdr_init_decode(xdr, buf, argv->iov_base, NULL); - xdr_set_scratch_page(xdr, rqstp->rq_scratch_page); + xdr_set_scratch_folio(xdr, rqstp->rq_scratch_folio); } /** --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c @@ -352,7 +352,7 @@ static int svc_pool_map_get_node(unsigne if (m->mode == SVC_POOL_PERNODE) return m->pool_to[pidx]; } - return NUMA_NO_NODE; + return numa_mem_id(); } /* * Set the given thread's cpus_allowed mask so that it @@ -734,8 +734,8 @@ svc_rqst_free(struct svc_rqst *rqstp) { folio_batch_release(&rqstp->rq_fbatch); svc_release_buffer(rqstp); - if (rqstp->rq_scratch_page) - put_page(rqstp->rq_scratch_page); + if (rqstp->rq_scratch_folio) + folio_put(rqstp->rq_scratch_folio); kfree(rqstp->rq_resp); kfree(rqstp->rq_argp); kfree(rqstp->rq_auth_data); @@ -756,8 +756,8 @@ svc_prepare_thread(struct svc_serv *serv rqstp->rq_server = serv; rqstp->rq_pool = pool; - rqstp->rq_scratch_page = alloc_pages_node(node, GFP_KERNEL, 0); - if (!rqstp->rq_scratch_page) + rqstp->rq_scratch_folio = __folio_alloc_node(GFP_KERNEL, 0, node); + if (!rqstp->rq_scratch_folio) goto out_enomem; rqstp->rq_argp = kmalloc_node(serv->sv_xdrsize, GFP_KERNEL, node);