public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] pNFS/filelayout: Fix coalescing test for single DS
@ 2022-12-20 17:31 Olga Kornievskaia
  2022-12-20 18:32 ` Trond Myklebust
  0 siblings, 1 reply; 2+ messages in thread
From: Olga Kornievskaia @ 2022-12-20 17:31 UTC (permalink / raw)
  To: trond.myklebust, anna.schumaker; +Cc: linux-nfs

When there is a single DS no striping constraints need to be placed on
the IO. When such constraint is applied then buffered reads don't
coalesce to the DS's rsize.

Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
---
 fs/nfs/filelayout/filelayout.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c
index ad34a33b0737..4974cd18ca46 100644
--- a/fs/nfs/filelayout/filelayout.c
+++ b/fs/nfs/filelayout/filelayout.c
@@ -783,6 +783,12 @@ filelayout_alloc_lseg(struct pnfs_layout_hdr *layoutid,
 	return &fl->generic_hdr;
 }
 
+static bool
+filelayout_lseg_is_striped(const struct nfs4_filelayout_segment *flseg)
+{
+	return flseg->num_fh > 1;
+}
+
 /*
  * filelayout_pg_test(). Called by nfs_can_coalesce_requests()
  *
@@ -803,6 +809,8 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev,
 	size = pnfs_generic_pg_test(pgio, prev, req);
 	if (!size)
 		return 0;
+	else if (!filelayout_lseg_is_striped(FILELAYOUT_LSEG(pgio->pg_lseg)))
+		return size;
 
 	/* see if req and prev are in the same stripe */
 	if (prev) {
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] pNFS/filelayout: Fix coalescing test for single DS
  2022-12-20 17:31 [PATCH v2] pNFS/filelayout: Fix coalescing test for single DS Olga Kornievskaia
@ 2022-12-20 18:32 ` Trond Myklebust
  0 siblings, 0 replies; 2+ messages in thread
From: Trond Myklebust @ 2022-12-20 18:32 UTC (permalink / raw)
  To: Olga Kornievskaia
  Cc: Trond Myklebust, Anna Schumaker, linux-nfs@vger.kernel.org



> On Dec 20, 2022, at 12:31, Olga Kornievskaia <olga.kornievskaia@gmail.com> wrote:
> 
> When there is a single DS no striping constraints need to be placed on
> the IO. When such constraint is applied then buffered reads don't
> coalesce to the DS's rsize.
> 
> Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
> ---
> fs/nfs/filelayout/filelayout.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
> 
> diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c
> index ad34a33b0737..4974cd18ca46 100644
> --- a/fs/nfs/filelayout/filelayout.c
> +++ b/fs/nfs/filelayout/filelayout.c
> @@ -783,6 +783,12 @@ filelayout_alloc_lseg(struct pnfs_layout_hdr *layoutid,
> return &fl->generic_hdr;
> }
> 
> +static bool
> +filelayout_lseg_is_striped(const struct nfs4_filelayout_segment *flseg)
> +{
> + return flseg->num_fh > 1;
> +}
> +
> /*
>  * filelayout_pg_test(). Called by nfs_can_coalesce_requests()
>  *
> @@ -803,6 +809,8 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev,
> size = pnfs_generic_pg_test(pgio, prev, req);
> if (!size)
> return 0;
> + else if (!filelayout_lseg_is_striped(FILELAYOUT_LSEG(pgio->pg_lseg)))
> + return size;
> 
> /* see if req and prev are in the same stripe */
> if (prev) {
> -- 
> 2.31.1
> 

That works for me. Thanks!
_________________________________
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-12-20 18:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-20 17:31 [PATCH v2] pNFS/filelayout: Fix coalescing test for single DS Olga Kornievskaia
2022-12-20 18:32 ` Trond Myklebust

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox