Thread (8 messages) 8 messages, 3 authors, 2021-07-09

Re: [PATCH v3 2/3] SUNRPC: Add svc_rqst_replace_page() API

From: Chuck Lever III <hidden>
Date: 2021-07-09 03:05:02
Also in: linux-nfs

On Jul 8, 2021, at 7:30 PM, Matthew Wilcox [off-list ref] wrote:

On Thu, Jul 08, 2021 at 11:26:29AM -0400, Chuck Lever wrote:
quoted
@@ -256,6 +256,9 @@ struct svc_rqst {
	struct page *		*rq_next_page; /* next reply page to use */
	struct page *		*rq_page_end;  /* one past the last page */

+	struct page		*rq_relpages[16];
+	int			rq_numrelpages;
This is only one struct page away from being a pagevec ... ?
quoted
@@ -838,6 +839,33 @@ svc_set_num_threads_sync(struct svc_serv *serv, struct svc_pool *pool, int nrser
}
EXPORT_SYMBOL_GPL(svc_set_num_threads_sync);

+static void svc_rqst_release_replaced_pages(struct svc_rqst *rqstp)
+{
+	release_pages(rqstp->rq_relpages, rqstp->rq_numrelpages);
+	rqstp->rq_numrelpages = 0;
This would be pagevec_release()
 986 void __pagevec_release(struct pagevec *pvec)
 987 {
 988         if (!pvec->percpu_pvec_drained) {
 989                 lru_add_drain();
 990                 pvec->percpu_pvec_drained = true;
 991         }
 992         release_pages(pvec->pages, pagevec_count(pvec));
 993         pagevec_reinit(pvec);
 994 }

Pretty much the same under the bonnet. Fair enough!


--
Chuck Lever



Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help