From patchwork Wed Jun 21 16:45:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13287667 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51D1FEB64D8 for ; Wed, 21 Jun 2023 16:46:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 543CE8D0007; Wed, 21 Jun 2023 12:46:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E12408D0006; Wed, 21 Jun 2023 12:46:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A62FF8D000A; Wed, 21 Jun 2023 12:46:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 4FFFB8D000C for ; Wed, 21 Jun 2023 12:46:06 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 24992409A9 for ; Wed, 21 Jun 2023 16:46:06 +0000 (UTC) X-FDA: 80927332332.22.D3E8460 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf12.hostedemail.com (Postfix) with ESMTP id 0EAE740005 for ; Wed, 21 Jun 2023 16:46:03 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="b7ub/H7B"; spf=none (imf12.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1687365964; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=AQBN8EOVNpFsbWS+GiPKIXRePvvUD9BdImp+Rjg78p8=; b=Ikz/RdsU2xTfWYwkbjt84rH91nUxLeMNaqrng2Pm/Tyz9DNPulcyO6fONngEVPxqRz3EK3 q36okkOXo1AMyDoTuZowDPzSn8Yw8oFj0aid8KSz4cAVunO9rdo6rjOfstFthPamDl3Pky tmEluNTyhC2IksjU/fJZeETnJzX49DM= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="b7ub/H7B"; spf=none (imf12.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687365964; a=rsa-sha256; cv=none; b=wuj8ThslDC5QxEviCeuzAnyjh7klD6DlkJk4vT2DWTQt6w3QbodN5ZFMcLL46HpLzhl8Tx EFFjyO0ZLnPMMjx4p1iWOuJFUbfdQ4uh/UFiRmkQy21AESyQmxcQ2Qq/pZmBeZcQu/KVfh rMPLxbHn1v5MltBT+WKS0scM4Kg/ols= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=AQBN8EOVNpFsbWS+GiPKIXRePvvUD9BdImp+Rjg78p8=; b=b7ub/H7BmTbgUPuQXUwrP95FRP 0IEUGdTz1HyQpbYbP/rbXcBqz+W7V+5ZyOjKUhJSJl1n0gWxNajfSW0gpLlDNGLr+5x3X7lQR0rGc sJWHL9uXmDvqiZXMwcdWkmeIwBlxZ0p2TGny4RZf+u9Oy/cwjqb38MgaLGQbLvGbHq+8CEI/DGZKo gUMOu3TMpZs3AvjXPtNNn7A40mwTZlRy5EJveUHHXZJ+ekg0kRdv2vQGboivcW/SubBxp2z4OSPtU 9wVf5kjxK4hgOVoj68acJOECaVXYQcN43ZnqYfbigs2K4HQL3lMwUjSgTAavCrqxUYqENlRUp9rhI tkXqYsRw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qC0y2-00EjER-5C; Wed, 21 Jun 2023 16:46:02 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org, Andrew Morton Cc: "Matthew Wilcox (Oracle)" , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-afs@lists.infradead.org, linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 09/13] net: Convert sunrpc from pagevec to folio_batch Date: Wed, 21 Jun 2023 17:45:53 +0100 Message-Id: <20230621164557.3510324-10-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230621164557.3510324-1-willy@infradead.org> References: <20230621164557.3510324-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 0EAE740005 X-Rspam-User: X-Stat-Signature: xmn61rpjwmn4mmxd15q7aeqp7rausc4c X-Rspamd-Server: rspam01 X-HE-Tag: 1687365963-163921 X-HE-Meta: U2FsdGVkX18TvpNkDY8XcGtjXqAl25bX75i8EAvCmMpPQMVK1EfTCSquo5Bvc/4nLS5emynqFhXgXfMPmgcFkOJerEsDaS6g+KhOFQgZNWJueK+89Q46zujHubHMpAChYHtfS8hY1qxVM8ygZX2r/tnEq9Tn/FVsoUyq923Sm95dW2NHJu4wRdhjNnqvhsm1foaVdP0t7Glitk/onBnEHAfnPgn/5KPuYNZKuji4wqwye+KGTU6R9mMYolK8GSsY9Z/HhWuQm3uEqTQip8+G4K/RO0DbPV7l88tuPsu07MKcxi3h0cQDmi9U97r7oeXeHUX21vYCFP6pxhG6fmtLBE0iY9q7PiU3sYkAuxzQ4ha6hlE9SJaL3RxvoYhEkc1McGYiub67bVQqmVQNsKpycT/fZyN5CZHoB6IYHlaVd47westNqLju/65n3mo4bVsvhv5/ORL9NWDSYSX7VzvqQ7Eau/5Q6P6cSL389l2KdiEocq6B+AerJrAIAd8Wu44Hav92gCbmrHsHdt2yKyBlAKMr6pouTRz7sUHINGjyK7Pyf52yeUc5x9C6dzqyRp9LG3f5LArW2J6BmR0oGKVfFEMpX2DgUre4aVabry1uUn9pPS0m+rjhJwCN1DyPCR3CPjYS0PsytOj7J8qkhYjrP/G83xZn8t28mUTMQhuTv4B4EUXJPVOCQVcjvEcJkD350VwCHCtBS4NSi0IjKSD4a5AEh5f5Tk81/PeAQ9U+hNnTnWrle49b2HYjXGbE6mToShXTBJylCPvQufH9KCwfaeqq0+ezmbXrkaUiDNSUdhVETtWEV4ufzuWUzHrLZ1kIHefzBEe7aTRf7tLzZ4+Jw+vEhVjj8b9d+NZNOW883WlgLpvqxnkcL+W9XkiE8qgDNOWzdGn5c0MBEPl0bwnonUbVAQ+FKpXSr+gj5MUM5aWY+0RL0/IJL+QVkEEV9P3kLrB+r6y5xBjuQ9G7iYU y5Nsm5jz w3HMCarXbpwTqs1QKNaF0bpxCTQhpzFEUd5sbWrIlMb2wqsgMIdC/Gxbd5MNMsI8LS0TskNbt7zouHf3ktpbQM6R8sYRO35HxBC2Guhh73iMZv1gutIggrk9p1cJT176gnVVPnx3bE+m2Kd4xNoeAnxGTE1rYOUJO5A3SiCopFBAmgivSIq+x5KX9dgrpdy6PEauV3A1w/Jc+HZBvGAZyZIpG2STypz4aRA30 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Remove the last usage of pagevecs. There is a slight change here; we now free the folio_batch as soon as it fills up instead of freeing the folio_batch when we try to add a page to a full batch. This should have no effect in practice. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Chuck Lever --- include/linux/sunrpc/svc.h | 2 +- net/sunrpc/svc.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index c2807e301790..f8751118c122 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h @@ -222,7 +222,7 @@ struct svc_rqst { struct page * *rq_next_page; /* next reply page to use */ struct page * *rq_page_end; /* one past the last page */ - struct pagevec rq_pvec; + struct folio_batch rq_fbatch; struct kvec rq_vec[RPCSVC_MAXPAGES]; /* generally useful.. */ struct bio_vec rq_bvec[RPCSVC_MAXPAGES]; diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index e7c101290425..587811a002c9 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c @@ -640,7 +640,7 @@ svc_rqst_alloc(struct svc_serv *serv, struct svc_pool *pool, int node) if (!rqstp) return rqstp; - pagevec_init(&rqstp->rq_pvec); + folio_batch_init(&rqstp->rq_fbatch); __set_bit(RQ_BUSY, &rqstp->rq_flags); rqstp->rq_server = serv; @@ -851,9 +851,9 @@ bool svc_rqst_replace_page(struct svc_rqst *rqstp, struct page *page) } if (*rqstp->rq_next_page) { - if (!pagevec_space(&rqstp->rq_pvec)) - __pagevec_release(&rqstp->rq_pvec); - pagevec_add(&rqstp->rq_pvec, *rqstp->rq_next_page); + if (!folio_batch_add(&rqstp->rq_fbatch, + page_folio(*rqstp->rq_next_page))) + __folio_batch_release(&rqstp->rq_fbatch); } get_page(page); @@ -887,7 +887,7 @@ void svc_rqst_release_pages(struct svc_rqst *rqstp) void svc_rqst_free(struct svc_rqst *rqstp) { - pagevec_release(&rqstp->rq_pvec); + folio_batch_release(&rqstp->rq_fbatch); svc_release_buffer(rqstp); if (rqstp->rq_scratch_page) put_page(rqstp->rq_scratch_page);