NFS: filelayout should use nfs_generic_pg_test
Subsystems (2)
PATCH 1/1 NFS: filelayout should use nfs_generic_pg_test
Use nfs_generic_pg_test instead of pnfs_generic_pg_test.
This fixes the BUG at fs/nfs/write.c:941 introduced by 89a58e32d9105c01022a757fb32ddc3b51bf0025.
I was able to trigger this BUG reliably using pynfs in pnfs mode, by using dd(1) to write many small blocks.
---
Fix proposed by Trond.
Benny- Does this make sense?
fs/nfs/nfs4filelayout.c | 2 +- fs/nfs/pagelist.c | 5 ++++- include/linux/nfs_page.h | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-)
fs/nfs/nfs4filelayout.c +1 -1
@@ -661,7 +661,7 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev,u64 p_stripe, r_stripe;u32 stripe_unit; -if (!pnfs_generic_pg_test (pgio, prev, req)) +if (!nfs_generic_pg_test (pgio, prev, req))return 0 ;if (!pgio->pg_lseg)
fs/nfs/pagelist.c +4 -1
@@ -204,7 +204,9 @@ nfs_wait_on_request(struct nfs_page *req) TASK_UNINTERRUPTIBLE); } -static bool nfs_generic_pg_test (struct nfs_pageio_descriptor *desc,struct nfs_page *prev,struct nfs_page *req) +bool +nfs_generic_pg_test (struct nfs_pageio_descriptor *desc,struct nfs_page *prev, +struct nfs_page *req) {/* * FIXME: ideally we should be able to coalesce all requests
@@ -218,6 +220,7 @@ static bool nfs_generic_pg_test(struct nfs_pageio_descriptor *desc, struct nfs_preturn desc->pg_count + req->wb_bytes <= desc->pg_bsize; } +EXPORT_SYMBOL_GPL (nfs_generic_pg_test);/** * nfs_pageio_init - initialise a page io descriptor
include/linux/nfs_page.h +2 -1
@@ -96,7 +96,8 @@ extern int nfs_wait_on_request(struct nfs_page *);extern void nfs_unlock_request (struct nfs_page *req);extern int nfs_set_page_tag_locked (struct nfs_page *req);extern void nfs_clear_page_tag_locked (struct nfs_page *req); - +extern bool nfs_generic_pg_test (struct nfs_pageio_descriptor *desc, +struct nfs_page *prev,struct nfs_page *req);/* * Lock the page of an asynchronous request without getting a new reference
Signature · 1 line
1.7.5.2
Quoted 24 lines · Weston Andros Adamson
Use
nfs_generic_pg_testinstead ofpnfs_generic_pg_test.This fixes the BUG at
fs/nfs/write.c:941introduced by89a58e32d9105c01022a757fb32ddc3b51bf0025.I was able to trigger this BUG reliably using pynfs in pnfs mode, by using dd(1) to write many small blocks.
Signed-off-by Weston Andros Adamson <[email protected]>---
Fix proposed by Trond.Benny- Does this make sense?
fs/nfs/nfs4filelayout.c | 2 +- fs/nfs/pagelist.c | 5 ++++- include/linux/nfs_page.h | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-)fs/nfs/nfs4filelayout.c +0
-0
fs/nfs/nfs4filelayout.c filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, · line 666
Quoted 7 lines
fs/nfs/nfs4filelayout.c +1
-1@@ -661,7 +661,7 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev,u64 p_stripe, r_stripe;u32 stripe_unit; -if (!pnfs_generic_pg_test (pgio, prev, req)) +if (!nfs_generic_pg_test (pgio, prev, req))return 0 ;
pnfs_generic_pg_test is the one that gets the layout.
What you've done is revert to MDS IO
Boaz
Quoted 38 lines
fs/nfs/nfs4filelayout.c +0
-0if (!pgio->pg_lseg)fs/nfs/pagelist.c +4
-1@@ -204,7 +204,9 @@ nfs_wait_on_request(struct nfs_page *req) TASK_UNINTERRUPTIBLE); } -static bool nfs_generic_pg_test (struct nfs_pageio_descriptor *desc,struct nfs_page *prev,struct nfs_page *req) +bool +nfs_generic_pg_test (struct nfs_pageio_descriptor *desc,struct nfs_page *prev, +struct nfs_page *req) {/* * FIXME: ideally we should be able to coalesce all requests @@ -218,6 +220,7 @@ static bool nfs_generic_pg_test(struct nfs_pageio_descriptor *desc, struct nfs_preturn desc->pg_count + req->wb_bytes <= desc->pg_bsize; } +EXPORT_SYMBOL_GPL (nfs_generic_pg_test);/** * nfs_pageio_init - initialise a page io descriptor include/linux/nfs_page.h +2
-1@@ -96,7 +96,8 @@ extern int nfs_wait_on_request(struct nfs_page *);extern void nfs_unlock_request (struct nfs_page *req);extern int nfs_set_page_tag_locked (struct nfs_page *req);extern void nfs_clear_page_tag_locked (struct nfs_page *req); - +extern bool nfs_generic_pg_test (struct nfs_pageio_descriptor *desc, +struct nfs_page *prev,struct nfs_page *req);/* * Lock the page of an asynchronous request without getting a new reference
Quoted 28 lines · Boaz Harrosh
Quoted 27 lines · Weston Andros Adamson
Use
nfs_generic_pg_testinstead ofpnfs_generic_pg_test.This fixes the BUG at
fs/nfs/write.c:941introduced by89a58e32d9105c01022a757fb32ddc3b51bf0025.I was able to trigger this BUG reliably using pynfs in pnfs mode, by using dd(1) to write many small blocks.
Signed-off-by Weston Andros Adamson <[email protected]>---
Fix proposed by Trond.Benny- Does this make sense?
fs/nfs/nfs4filelayout.c | 2 +- fs/nfs/pagelist.c | 5 ++++- include/linux/nfs_page.h | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-)fs/nfs/nfs4filelayout.c +0
-0@@ -661,7 +661,7 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev,u64 p_stripe, r_stripe;u32 stripe_unit;
Quoted 8 lines
fs/nfs/nfs4filelayout.c filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, · line 666
Quoted 4 lines
fs/nfs/nfs4filelayout.c +1
-1-if (!pnfs_generic_pg_test (pgio, prev, req)) +if (!nfs_generic_pg_test (pgio, prev, req))return 0 ;
pnfs_generic_pg_testis the one that gets the layout.What you've done is revert to MDS IO
The "files" layout type always gets the layout in the pg_doio() method instead of the pg_test().
Cheers
Trond
Signature · 6 lines
Trond Myklebust Linux NFS client maintainer NetApp [email protected] www.netapp.com
Quoted 10 lines · Trond Myklebust
Quoted 5 lines · Boaz Harrosh
On 06/01/2011 06:18 AM, Weston Andros Adamson wrote:
pnfs_generic_pg_testis the one that gets the layout.What you've done is revert to MDS IO
The "files" layout type always gets the layout in the
pg_doio()method instead of thepg_test().
Well I don't see where? I fought this all day, when trying to make the new code run with objlayout, which was missing the implementation of pg_test(). And never got a pnfs-IO.
I've searched the full tree for calls to pnfs_update_layout() the only one I can see are in:nfs_pagein_multi() - which means within a single page, right?nfs_pagein_one() - But is protected with list_is_singular() so only in the
single page casenfs_flush_multi() - Same as nfs_pagein_multinfs_flush_one() - Also here protected with list_is_singular()
and the all mightypnfs_generic_pg_test()
I cannot see where the filelayout is different then other layouts in that respect. Sorry to be slow, I would like to understand?
And also be careful with nfs_generic_pg_test() it inspects desc->bsize which is negotiated with MDS, it's very small.
Quoted 3 lines
Cheers
Trond
Thanks
Boaz
Quoted 24 lines · Boaz Harrosh
Quoted 10 lines · Trond Myklebust
Quoted 5 lines · Boaz Harrosh
On 06/01/2011 06:18 AM, Weston Andros Adamson wrote:
pnfs_generic_pg_testis the one that gets the layout.What you've done is revert to MDS IO
The "files" layout type always gets the layout in the
pg_doio()method instead of thepg_test().Well I don't see where? I fought this all day, when trying to make the new code run with objlayout, which was missing the implementation of
pg_test(). And never got a pnfs-IO.I've searched the full tree for calls to
pnfs_update_layout()the only one I can see are in:nfs_pagein_multi()- which means within a single page, right?nfs_pagein_one()- But is protected withlist_is_singular()so only in the
single page casenfs_flush_multi()- Same asnfs_pagein_multinfs_flush_one()- Also here protected withlist_is_singular()
Quoted 9 lines
and the all mighty
pnfs_generic_pg_test()I cannot see where the filelayout is different then other layouts in that respect. Sorry to be slow, I would like to understand?
And also be careful with
nfs_generic_pg_test()it inspectsdesc->bsizewhich is negotiated with MDS, it's very small.
I'm also looking into this.
The call to pnfs_generic_pg_test wasn't a typo.
As pre dfed206 "NFSv4.1: unify pnfs_pageio_init functions"
we were setting pg_pgio->test to pnfs_write_pg_test
which is equivalent to pnfs_generic_pg_test
and 89a58e3 "NFSv4.1: use pnfs_generic_pg_test directly by layout driver" only reversed the call from pnfs_generic_pg_test to ld->pg_test to a call from ld->pg_test to pnfs_generic_pg_test
Benny
Quoted 10 lines
Quoted 3 lines
Cheers
TrondThanks
Boaz
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
I guess the culprit is the moving of the desc->pg_bsize < PAGE_SIZE condition to nfs_generic_pg_test in 5b36c7dc.
Previously, it stopped coalescing early for both nfs and pnfs but with this patch it is performed only when pnfs is disabled.
Benny
Quoted 61 lines · Benny Halevy
Quoted 24 lines · Boaz Harrosh
Quoted 10 lines · Trond Myklebust
Quoted 5 lines · Boaz Harrosh
On 06/01/2011 06:18 AM, Weston Andros Adamson wrote:
pnfs_generic_pg_testis the one that gets the layout.What you've done is revert to MDS IO
The "files" layout type always gets the layout in the
pg_doio()method instead of thepg_test().Well I don't see where? I fought this all day, when trying to make the new code run with objlayout, which was missing the implementation of
pg_test(). And never got a pnfs-IO.I've searched the full tree for calls to
pnfs_update_layout()the only one I can see are in:nfs_pagein_multi()- which means within a single page, right?nfs_pagein_one()- But is protected withlist_is_singular()so only in the
single page casenfs_flush_multi()- Same asnfs_pagein_multinfs_flush_one()- Also here protected withlist_is_singular()Quoted 9 lines
and the all mighty
pnfs_generic_pg_test()I cannot see where the filelayout is different then other layouts in that respect. Sorry to be slow, I would like to understand?
And also be careful with
nfs_generic_pg_test()it inspectsdesc->bsizewhich is negotiated with MDS, it's very small.I'm also looking into this.
The call topnfs_generic_pg_testwasn't a typo.
As pre dfed206 "NFSv4.1: unifypnfs_pageio_initfunctions"
we were settingpg_pgio->testtopnfs_write_pg_test
which is equivalent topnfs_generic_pg_test
and 89a58e3 "NFSv4.1: usepnfs_generic_pg_testdirectly by layout driver" only reversed the call frompnfs_generic_pg_testtold->pg_testto a call fromld->pg_testtopnfs_generic_pg_testBenny
Quoted 10 lines
Quoted 3 lines
Cheers
TrondThanks
Boaz
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 35 lines · Boaz Harrosh
Quoted 24 lines · Weston Andros Adamson
Use
nfs_generic_pg_testinstead ofpnfs_generic_pg_test.This fixes the BUG at
fs/nfs/write.c:941introduced by89a58e32d9105c01022a757fb32ddc3b51bf0025.I was able to trigger this BUG reliably using pynfs in pnfs mode, by using dd(1) to write many small blocks.
Signed-off-by Weston Andros Adamson <[email protected]>---
Fix proposed by Trond.Benny- Does this make sense?
fs/nfs/nfs4filelayout.c | 2 +- fs/nfs/pagelist.c | 5 ++++- include/linux/nfs_page.h | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-)fs/nfs/nfs4filelayout.c +0
-0fs/nfs/nfs4filelayout.c filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, · line 666
Quoted 7 lines
fs/nfs/nfs4filelayout.c +1
-1@@ -661,7 +661,7 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev,u64 p_stripe, r_stripe;u32 stripe_unit; -if (!pnfs_generic_pg_test (pgio, prev, req)) +if (!nfs_generic_pg_test (pgio, prev, req))return 0 ;
pnfs_generic_pg_testis the one that gets the layout.
Quoted 3 lines
What you've done is revert to MDS IO
Boaz
Ah, you're right - I didn't even notice that! I usually confirm client -> DS communication with tcpdump. I was working for too long yesterday :)
Patch: recalled. Discussion about a real fix: started.
-dros
Quoted 40 lines · Weston Andros Adamson
Quoted 37 lines · Boaz Harrosh
Quoted 24 lines · Weston Andros Adamson
Use
nfs_generic_pg_testinstead ofpnfs_generic_pg_test.This fixes the BUG at
fs/nfs/write.c:941introduced by89a58e32d9105c01022a757fb32ddc3b51bf0025.I was able to trigger this BUG reliably using pynfs in pnfs mode, by using dd(1) to write many small blocks.
Signed-off-by Weston Andros Adamson <[email protected]>---
Fix proposed by Trond.Benny- Does this make sense?
fs/nfs/nfs4filelayout.c | 2 +- fs/nfs/pagelist.c | 5 ++++- include/linux/nfs_page.h | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-)fs/nfs/nfs4filelayout.c +0
-0fs/nfs/nfs4filelayout.c filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, · line 666
Quoted 7 lines
fs/nfs/nfs4filelayout.c +1
-1@@ -661,7 +661,7 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev,u64 p_stripe, r_stripe;u32 stripe_unit; -if (!pnfs_generic_pg_test (pgio, prev, req)) +if (!nfs_generic_pg_test (pgio, prev, req))return 0 ;
pnfs_generic_pg_testis the one that gets the layout.What you've done is revert to MDS IO
Quoted 7 lines
Quoted 1 line
Boaz
Ah, you're right - I didn't even notice that! I usually confirm client -> DS communication with tcpdump. I was working for too long yesterday :)
Patch: recalled. Discussion about a real fix: started.
-dros
I think the following should work:
Benny
git diff --stat -p -M
fs/nfs/nfs4filelayout.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)
fs/nfs/nfs4filelayout.c +0 -0
@@ -661,6 +661,16 @@ filelayout_pg_test(struct nfs_pageio_descriptor
*pgio, struct nfs_page *prev,
u64 p_stripe, r_stripe;
u32 stripe_unit;
+ /*
+ * FIXME: ideally we should be able to coalesce all requests
+ * that are not block boundary aligned, but currently this
+ * is problematic for the case of bsize < PAGE_CACHE_SIZE,
+ * since nfs_flush_multi and nfs_pagein_multi assume you
+ * can have only one struct nfs_page.
+ */
+ if (desc->pg_bsize < PAGE_SIZE)
+ return 0;
+
if (!pnfs_generic_pg_test(pgio, prev, req))
return 0;
Quoted 45 lines · Benny Halevy
Quoted 44 lines · Weston Andros Adamson
Quoted 35 lines · Boaz Harrosh
Quoted 24 lines · Weston Andros Adamson
Use
nfs_generic_pg_testinstead ofpnfs_generic_pg_test.This fixes the BUG at
fs/nfs/write.c:941introduced by89a58e32d9105c01022a757fb32ddc3b51bf0025.I was able to trigger this BUG reliably using pynfs in pnfs mode, by using dd(1) to write many small blocks.
Signed-off-by Weston Andros Adamson <[email protected]>---
Fix proposed by Trond.Benny- Does this make sense?
fs/nfs/nfs4filelayout.c | 2 +- fs/nfs/pagelist.c | 5 ++++- include/linux/nfs_page.h | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-)fs/nfs/nfs4filelayout.c +0
-0fs/nfs/nfs4filelayout.c filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, · line 666
Quoted 7 lines
fs/nfs/nfs4filelayout.c +1
-1@@ -661,7 +661,7 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev,u64 p_stripe, r_stripe;u32 stripe_unit; -if (!pnfs_generic_pg_test (pgio, prev, req)) +if (!nfs_generic_pg_test (pgio, prev, req))return 0 ;
pnfs_generic_pg_testis the one that gets the layout.Quoted 3 lines
What you've done is revert to MDS IO
Boaz
Ah, you're right - I didn't even notice that! I usually confirm client -> DS communication with tcpdump. I was working for too long yesterday :)
Quoted 8 lines
Quoted 3 lines
Patch: recalled. Discussion about a real fix: started.
-dros
I think the following should work:
Benny
This diff fixes the problem for me (but with s/desc/pgio).
-dros
Quoted 30 lines
git diff --stat -p -M
fs/nfs/nfs4filelayout.c| 10 ++++++++++1 files changed, 10 insertions(+), 0 deletions(-)fs/nfs/nfs4filelayout.c +10
-1@@ -661,6 +661,16 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, u64 p_stripe, r_stripe;u32 stripe_unit; +/* +* FIXME: ideally we should be able to coalesce all requests +* that are not block boundary aligned, but currently this +* is problematic for the case of bsize < PAGE_CACHE_SIZE, +* since nfs_flush_multi and nfs_pagein_multi assume you +* can have only one struct nfs_page. +*/ +if (desc->pg_bsize <PAGE_SIZE ) +return 0 ; +if (!pnfs_generic_pg_test (pgio, prev, req))return 0 ; --To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 69 lines · Benny Halevy
Quoted 40 lines · Weston Andros Adamson
Quoted 37 lines · Boaz Harrosh
Quoted 24 lines · Weston Andros Adamson
Use
nfs_generic_pg_testinstead ofpnfs_generic_pg_test.This fixes the BUG at
fs/nfs/write.c:941introduced by89a58e32d9105c01022a757fb32ddc3b51bf0025.I was able to trigger this BUG reliably using pynfs in pnfs mode, by using dd(1) to write many small blocks.
Signed-off-by Weston Andros Adamson <[email protected]>---
Fix proposed by Trond.Benny- Does this make sense?
fs/nfs/nfs4filelayout.c| 2 +-fs/nfs/pagelist.c| 5 ++++-include/linux/nfs_page.h| 3 ++-3 files changed, 7 insertions(+), 3 deletions(-)fs/nfs/nfs4filelayout.c +0
-0fs/nfs/nfs4filelayout.c filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, · line 666
Quoted 7 lines
fs/nfs/nfs4filelayout.c +1
-1@@ -661,7 +661,7 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, u64 p_stripe, r_stripe; u32 stripe_unit; - if (!pnfs_generic_pg_test(pgio, prev, req)) + if (!nfs_generic_pg_test(pgio, prev, req)) return 0;
pnfs_generic_pg_testis the one that gets the layout.What you've done is revert to MDS IO
Quoted 7 lines
Quoted 1 line
Boaz
Ah, you're right - I didn't even notice that! I usually confirm client -> DS communication with tcpdump. I was working for too long yesterday :)
Patch: recalled. Discussion about a real fix: started.
-dros
I think the following should work:
Benny
git diff --stat -p -M
fs/nfs/nfs4filelayout.c | 10 ++++++++++1 files changed, 10 insertions(+), 0 deletions(-)fs/nfs/nfs4filelayout.c +2
-0@@ -661,6 +661,16 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, u64 p_stripe, r_stripe; u32 stripe_unit; + /* +* FIXME: ideally we should be able to coalesce all requests
fs/nfs/nfs4filelayout.c filelayout_pg_test(struct nfs_pageio_descriptor · line 676
Quoted 10 lines
fs/nfs/nfs4filelayout.c +8
-0+* that are not block boundary aligned, but currently this +* is problematic for the case of bsize < PAGE_CACHE_SIZE, +* since nfs_flush_multi and nfs_pagein_multi assume you +* can have only one struct nfs_page. +*/ + if (desc->pg_bsize < PAGE_SIZE) + return 0; + if (!pnfs_generic_pg_test(pgio, prev, req)) return 0;
Note this moves a test that was once part of the plain nfs code into the file layout driver. Why don't other drivers need this test?
Fred
Quoted 67 lines · Fred Isaman
Quoted 66 lines · Benny Halevy
Quoted 40 lines · Weston Andros Adamson
Quoted 37 lines · Boaz Harrosh
Quoted 24 lines · Weston Andros Adamson
Use
nfs_generic_pg_testinstead ofpnfs_generic_pg_test.This fixes the BUG at
fs/nfs/write.c:941introduced by89a58e32d9105c01022a757fb32ddc3b51bf0025.I was able to trigger this BUG reliably using pynfs in pnfs mode, by using dd(1) to write many small blocks.
Signed-off-by Weston Andros Adamson <[email protected]>---
Fix proposed by Trond.Benny- Does this make sense?
fs/nfs/nfs4filelayout.c | 2 +- fs/nfs/pagelist.c | 5 ++++- include/linux/nfs_page.h | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-)fs/nfs/nfs4filelayout.c +0
-0fs/nfs/nfs4filelayout.c filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, · line 666
Quoted 7 lines
fs/nfs/nfs4filelayout.c +1
-1@@ -661,7 +661,7 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev,u64 p_stripe, r_stripe;u32 stripe_unit; -if (!pnfs_generic_pg_test (pgio, prev, req)) +if (!nfs_generic_pg_test (pgio, prev, req))return 0 ;
pnfs_generic_pg_testis the one that gets the layout.What you've done is revert to MDS IO
Quoted 7 lines
Quoted 1 line
Boaz
Ah, you're right - I didn't even notice that! I usually confirm client -> DS communication with tcpdump. I was working for too long yesterday :)
Patch: recalled. Discussion about a real fix: started.
-dros
I think the following should work:
Benny
git diff --stat -p -M
fs/nfs/nfs4filelayout.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)fs/nfs/nfs4filelayout.c +0
-0@@ -661,6 +661,16 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, u64 p_stripe, r_stripe;u32 stripe_unit;
Quoted 16 lines
fs/nfs/nfs4filelayout.c filelayout_pg_test(struct nfs_pageio_descriptor · line 676
Quoted 13 lines
fs/nfs/nfs4filelayout.c +10
-0+/* +* FIXME: ideally we should be able to coalesce all requests +* that are not block boundary aligned, but currently this +* is problematic for the case of bsize < PAGE_CACHE_SIZE, +* since nfs_flush_multi and nfs_pagein_multi assume you +* can have only one struct nfs_page. +*/ +if (desc->pg_bsize <PAGE_SIZE ) +return 0 ; +if (!pnfs_generic_pg_test (pgio, prev, req))return 0 ;Note this moves a test that was once part of the plain nfs code into the file layout driver. Why don't other drivers need this test?
True. Note I said it would work, not that it's the right fix? :-/ This just tells us what change exposed this issue...
Boaz moved this check to the nfs only path assuming that pg_bsize, which holds the MDS's wsize/rsize is irrelevant for coalescing requests for striping over pnfs.
I'm still convinced why nfs_flush_multi cannot use desc->pg_lseg if it exists, but at the same time it seems like not doing the right thing for pnfs coalescing in nfs_pageio_init_write and nfs_pageio_do_add_request.
For pnfs, we need to ignore wsize, meaning we first need to try to coalesce the pages and then decide if we're going the nfs_flush_multi or the nfs_flush_one way, based on the coalesced length.
Benny
Quoted 6 lines
Fred
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 3 lines · Benny Halevy
For pnfs, we need to ignore wsize, meaning we first need to try to coalesce the pages and then decide if we're going the
nfs_flush_multior thenfs_flush_oneway, based on the coalesced length.
No! Ignoring the wsize is definitely wrong... If the stripe size is larger than the 'maxwrite' recommended attribute, then the DS is allowed to do a short write, in which case we have to resend.
In any case, nfs_flush_multi and nfs_flush_one need a rewrite in order to deal properly with O_DIRECT writes, and so I'm expecting to get rid of the single nfs_page limit for the r/wsize<PAGE_SIZE case. Please don't make any large changes to this code at this time.
Signature · 6 lines
Trond Myklebust Linux NFS client maintainer NetApp [email protected] www.netapp.com
Quoted 10 lines · Trond Myklebust
Quoted 3 lines · Benny Halevy
For pnfs, we need to ignore wsize, meaning we first need to try to coalesce the pages and then decide if we're going the
nfs_flush_multior thenfs_flush_oneway, based on the coalesced length.No! Ignoring the wsize is definitely wrong... If the stripe size is larger than the 'maxwrite' recommended attribute, then the DS is allowed to do a short write, in which case we have to resend.
As far as I could understand the current code, desc->bsize which derives from wsize/rsize is negotiated with the MDS. But the wsize in question is the DS's one. So I think in pnfs it is only the layout-driver that can check this properly against the filer in question. Only if IO is to go through MDS the bsize check is relevant.
BTW: The BUG_ON() Andy hit, does not look like an hard bug to fix ;-)
Quoted 5 lines
In any case,
nfs_flush_multiandnfs_flush_oneneed a rewrite in order to deal properly withO_DIRECTwrites, and so I'm expecting to get rid of the singlenfs_pagelimit for the r/wsize<PAGE_SIZE case. Please don't make any large changes to this code at this time.
Amen, Good riddance
Boaz
Quoted 12 lines · Boaz Harrosh
Quoted 10 lines · Trond Myklebust
Quoted 3 lines · Benny Halevy
For pnfs, we need to ignore wsize, meaning we first need to try to coalesce the pages and then decide if we're going the
nfs_flush_multior thenfs_flush_oneway, based on the coalesced length.No! Ignoring the wsize is definitely wrong... If the stripe size is larger than the 'maxwrite' recommended attribute, then the DS is allowed to do a short write, in which case we have to resend.
Quoted 5 lines
As far as I could understand the current code,
desc->bsizewhich derives from wsize/rsize is negotiated with the MDS. But the wsize in question is the DS's one. So I think in pnfs it is only the layout-driver that can check this properly against the filer in question. Only if IO is to go through MDS the bsize check is relevant.
There is no distinction between the MDS's idea of the wsize and the DS's idea of the wsize. The DS has to support the same wsize as the MDS, since the client has no way of querying the wsize from the DS (GETATTR maxwrite is not on the allowed set of DS operations)...
Quoted 9 lines
BTW: The
BUG_ON()Andy hit, does not look like an hard bug to fix ;-)Quoted 5 lines
In any case,
nfs_flush_multiandnfs_flush_oneneed a rewrite in order to deal properly withO_DIRECTwrites, and so I'm expecting to get rid of the singlenfs_pagelimit for the r/wsize<PAGE_SIZE case. Please don't make any large changes to this code at this time.Amen, Good riddance
:-)
Signature · 6 lines
Trond Myklebust Linux NFS client maintainer NetApp [email protected] www.netapp.com
Quoted 6 lines · Trond Myklebust
There is no distinction between the MDS's idea of the wsize and the DS's idea of the wsize. The DS has to support the same wsize as the MDS, since the client has no way of querying the wsize from the DS (GETATTR maxwrite is not on the allowed set of DS operations)...
OK I did not know that. Good god how broken is that?
Any way you are probably right. But then the check properly belongs in files-layout driver. Surly it has nothing to do with objects, and blocks
Thanks
Boaz
Quoted 8 lines · Boaz Harrosh
Quoted 6 lines · Trond Myklebust
There is no distinction between the MDS's idea of the wsize and the DS's idea of the wsize. The DS has to support the same wsize as the MDS, since the client has no way of querying the wsize from the DS (GETATTR maxwrite is not on the allowed set of DS operations)...
Quoted 4 lines
OK I did not know that. Good god how broken is that?
Any way you are probably right. But then the check properly belongs in files-layout driver. Surly it has nothing to do with objects, and blocks
It belongs in the 'files' layout and in the generic (i.e. v2/v3/v4) code.
Signature · 6 lines
Trond Myklebust Linux NFS client maintainer NetApp [email protected] www.netapp.com
Quoted 19 lines · Benny Halevy
I think the following should work:
Benny
git diff --stat -p -M
fs/nfs/nfs4filelayout.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)fs/nfs/nfs4filelayout.c +2
-0@@ -661,6 +661,16 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, u64 p_stripe, r_stripe;u32 stripe_unit; +/* +* FIXME: ideally we should be able to coalesce all requests
fs/nfs/nfs4filelayout.c filelayout_pg_test(struct nfs_pageio_descriptor · line 676
Quoted 10 lines
fs/nfs/nfs4filelayout.c +8
-0+* that are not block boundary aligned, but currently this +* is problematic for the case of bsize < PAGE_CACHE_SIZE, +* since nfs_flush_multi and nfs_pagein_multi assume you +* can have only one struct nfs_page. +*/ +if (desc->pg_bsize <PAGE_SIZE ) +return 0 ; +if (!pnfs_generic_pg_test (pgio, prev, req))return 0 ;
So, there are several things that bother me about pnfs_generic_pg_test() too now that I'm looking more closely at it:
1. If the intention is to coalesce 'prev' and 'req', shouldn't we be asking for a layout with req_offset(prev) instead of req_offset(req)?
2. If we're only requesting a layout of length pg_count, don't we still need to test the layout length that the server actually returned before we can allow the coalescing?
3. if (!pgio->lseg), shouldn't we be returning an error of some sort? Right now we're returning 'true', and allowing the coalesce to occur.
4. Furthermore, shouldn't that test guarding the pnfs_update_layout() call rather be an 'if (pgio->pg_lseg == NULL)' instead of looking at the values of pg_count and prev->wb_bytes?
Signature · 6 lines
Trond Myklebust Linux NFS client maintainer NetApp [email protected] www.netapp.com
Quoted 34 lines · Trond Myklebust
Quoted 19 lines · Benny Halevy
I think the following should work:
Benny
git diff --stat -p -M
fs/nfs/nfs4filelayout.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)fs/nfs/nfs4filelayout.c +2
-0@@ -661,6 +661,16 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, u64 p_stripe, r_stripe;u32 stripe_unit; +/* +* FIXME: ideally we should be able to coalesce all requests fs/nfs/nfs4filelayout.c filelayout_pg_test(struct nfs_pageio_descriptor · line 676
Quoted 10 lines
fs/nfs/nfs4filelayout.c +8
-0+* that are not block boundary aligned, but currently this +* is problematic for the case of bsize < PAGE_CACHE_SIZE, +* since nfs_flush_multi and nfs_pagein_multi assume you +* can have only one struct nfs_page. +*/ +if (desc->pg_bsize <PAGE_SIZE ) +return 0 ; +if (!pnfs_generic_pg_test (pgio, prev, req))return 0 ;So, there are several things that bother me about
pnfs_generic_pg_test()too now that I'm looking more closely at it:
Quoted 14 lines
1. If the intention is to coalesce 'prev' and 'req', shouldn't we be asking for a layout with
req_offset(prev)instead ofreq_offset(req)?
2. If we're only requesting a layout of lengthpg_count, don't we still need to test the layout length that the server actually returned before we can allow the coalescing?
3. if (!pgio->lseg), shouldn't we be returning an error of some sort? Right now we're returning 'true', and allowing the coalesce to occur.
4. Furthermore, shouldn't that test guarding thepnfs_update_layout()call rather be an 'if (pgio->pg_lseg== NULL)' instead of looking at the values ofpg_countandprev->wb_bytes?
or rather we get the layout for the first page in nfs_pageio_do_add_request when desc->pg_count == 0?
Then, this lseg would be useful for nfs_flush_multi if we failed to coalesce, or we failed to get a layout altogether we go the nfs path and can reset pg_test to nfs_generic_pg_test.
Otherwise I agree with your assertions above.
Benny
Quoted 50 lines · Benny Halevy
Quoted 34 lines · Trond Myklebust
Quoted 19 lines · Benny Halevy
I think the following should work:
Benny
git diff --stat -p -M
fs/nfs/nfs4filelayout.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)fs/nfs/nfs4filelayout.c +2
-0@@ -661,6 +661,16 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, u64 p_stripe, r_stripe;u32 stripe_unit; +/* +* FIXME: ideally we should be able to coalesce all requests fs/nfs/nfs4filelayout.c filelayout_pg_test(struct nfs_pageio_descriptor · line 676
Quoted 10 lines
fs/nfs/nfs4filelayout.c +8
-0+* that are not block boundary aligned, but currently this +* is problematic for the case of bsize < PAGE_CACHE_SIZE, +* since nfs_flush_multi and nfs_pagein_multi assume you +* can have only one struct nfs_page. +*/ +if (desc->pg_bsize <PAGE_SIZE ) +return 0 ; +if (!pnfs_generic_pg_test (pgio, prev, req))return 0 ;So, there are several things that bother me about
pnfs_generic_pg_test()too now that I'm looking more closely at it:Quoted 14 lines
1. If the intention is to coalesce 'prev' and 'req', shouldn't we be asking for a layout with
req_offset(prev)instead ofreq_offset(req)?
2. If we're only requesting a layout of lengthpg_count, don't we still need to test the layout length that the server actually returned before we can allow the coalescing?
3. if (!pgio->lseg), shouldn't we be returning an error of some sort? Right now we're returning 'true', and allowing the coalesce to occur.
4. Furthermore, shouldn't that test guarding thepnfs_update_layout()call rather be an 'if (pgio->pg_lseg== NULL)' instead of looking at the values ofpg_countandprev->wb_bytes?
Quoted 2 lines
or rather we get the layout for the first page in
nfs_pageio_do_add_requestwhendesc->pg_count== 0?
I can live with a desc->pg_init() callback or rather, converting pg_test() and pg_doio() into a
struct nfs_pageio_ops {
int (*pg_init)(struct nfs_pageio_descriptor *desc, struct nfs_page *req);
bool (*pg_test)(struct nfs_pageio_descriptor *desc, struct nfs_page *prev, struct nfs_page *req);
int (*pg_doio)(struct nfs_pageio_descriptor *desc);
};and then replacing the two callback functions in the existing struct nfs_pageio_descriptor with a single pointer to a 'const struct nfs_pageio_ops'...
Quoted 4 lines
Then, this lseg would be useful for
nfs_flush_multiif we failed to coalesce, or we failed to get a layout altogether we go the nfs path and can resetpg_testtonfs_generic_pg_test.
It would presumably also get rid of all those pnfs_update_layout() calls in read.c and write.c.
Signature · 6 lines
Trond Myklebust Linux NFS client maintainer NetApp [email protected] www.netapp.com
Quoted 63 lines · Trond Myklebust
Quoted 50 lines · Benny Halevy
Quoted 34 lines · Trond Myklebust
Quoted 19 lines · Benny Halevy
I think the following should work:
Benny
git diff --stat -p -M
fs/nfs/nfs4filelayout.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)fs/nfs/nfs4filelayout.c +2
-0@@ -661,6 +661,16 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, u64 p_stripe, r_stripe;u32 stripe_unit; +/* +* FIXME: ideally we should be able to coalesce all requests fs/nfs/nfs4filelayout.c filelayout_pg_test(struct nfs_pageio_descriptor · line 676
Quoted 10 lines
fs/nfs/nfs4filelayout.c +8
-0+* that are not block boundary aligned, but currently this +* is problematic for the case of bsize < PAGE_CACHE_SIZE, +* since nfs_flush_multi and nfs_pagein_multi assume you +* can have only one struct nfs_page. +*/ +if (desc->pg_bsize <PAGE_SIZE ) +return 0 ; +if (!pnfs_generic_pg_test (pgio, prev, req))return 0 ;So, there are several things that bother me about
pnfs_generic_pg_test()too now that I'm looking more closely at it:Quoted 14 lines
1. If the intention is to coalesce 'prev' and 'req', shouldn't we be asking for a layout with
req_offset(prev)instead ofreq_offset(req)?
2. If we're only requesting a layout of lengthpg_count, don't we still need to test the layout length that the server actually returned before we can allow the coalescing?
3. if (!pgio->lseg), shouldn't we be returning an error of some sort? Right now we're returning 'true', and allowing the coalesce to occur.
4. Furthermore, shouldn't that test guarding thepnfs_update_layout()call rather be an 'if (pgio->pg_lseg== NULL)' instead of looking at the values ofpg_countandprev->wb_bytes?Quoted 2 lines
or rather we get the layout for the first page in
nfs_pageio_do_add_requestwhendesc->pg_count== 0?I can live with a
desc->pg_init()callback or rather, convertingpg_test()andpg_doio()into astruct nfs_pageio_ops { int (*pg_init)(struct nfs_pageio_descriptor *desc, struct nfs_page *req); bool (*pg_test)(struct nfs_pageio_descriptor *desc, struct nfs_page *prev, struct nfs_page *req); int (*pg_doio)(struct nfs_pageio_descriptor *desc); };
Quoted 4 lines
and then replacing the two callback functions in the existing struct
nfs_pageio_descriptorwith a single pointer to a 'const structnfs_pageio_ops'...
looks like a good way to do this!
Quoted 8 lines
Quoted 4 lines
Then, this lseg would be useful for
nfs_flush_multiif we failed to coalesce, or we failed to get a layout altogether we go the nfs path and can resetpg_testtonfs_generic_pg_test.It would presumably also get rid of all those
pnfs_update_layout()calls inread.candwrite.c.
Yup.
Quoted 64 lines · Benny Halevy
Quoted 63 lines · Trond Myklebust
Quoted 50 lines · Benny Halevy
Quoted 34 lines · Trond Myklebust
Quoted 19 lines · Benny Halevy
I think the following should work:
Benny
git diff --stat -p -M
fs/nfs/nfs4filelayout.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)fs/nfs/nfs4filelayout.c +2
-0@@ -661,6 +661,16 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, u64 p_stripe, r_stripe;u32 stripe_unit; +/* +* FIXME: ideally we should be able to coalesce all requests fs/nfs/nfs4filelayout.c filelayout_pg_test(struct nfs_pageio_descriptor · line 676
Quoted 10 lines
fs/nfs/nfs4filelayout.c +8
-0+* that are not block boundary aligned, but currently this +* is problematic for the case of bsize < PAGE_CACHE_SIZE, +* since nfs_flush_multi and nfs_pagein_multi assume you +* can have only one struct nfs_page. +*/ +if (desc->pg_bsize <PAGE_SIZE ) +return 0 ; +if (!pnfs_generic_pg_test (pgio, prev, req))return 0 ;So, there are several things that bother me about
pnfs_generic_pg_test()too now that I'm looking more closely at it:Quoted 14 lines
1. If the intention is to coalesce 'prev' and 'req', shouldn't we be asking for a layout with
req_offset(prev)instead ofreq_offset(req)?
2. If we're only requesting a layout of lengthpg_count, don't we still need to test the layout length that the server actually returned before we can allow the coalescing?
3. if (!pgio->lseg), shouldn't we be returning an error of some sort? Right now we're returning 'true', and allowing the coalesce to occur.
4. Furthermore, shouldn't that test guarding thepnfs_update_layout()call rather be an 'if (pgio->pg_lseg== NULL)' instead of looking at the values ofpg_countandprev->wb_bytes?Quoted 2 lines
or rather we get the layout for the first page in
nfs_pageio_do_add_requestwhendesc->pg_count== 0?I can live with a
desc->pg_init()callback or rather, convertingpg_test()andpg_doio()into astruct nfs_pageio_ops { int (*pg_init)(struct nfs_pageio_descriptor *desc, struct nfs_page *req); bool (*pg_test)(struct nfs_pageio_descriptor *desc, struct nfs_page *prev, struct nfs_page *req); int (*pg_doio)(struct nfs_pageio_descriptor *desc); };
Quoted 6 lines
Quoted 4 lines
and then replacing the two callback functions in the existing struct
nfs_pageio_descriptorwith a single pointer to a 'const structnfs_pageio_ops'...looks like a good way to do this!
Is anyone coding this fix?
-->Andy
Quoted 16 lines
Quoted 9 lines
Quoted 5 lines
Then, this lseg would be useful for
nfs_flush_multiif we failed to coalesce, or we failed to get a layout altogether we go the nfs path and can resetpg_testtonfs_generic_pg_test.It would presumably also get rid of all those
pnfs_update_layout()calls inread.candwrite.c.Yup.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 65 lines · William A. (Andy) Adamson
Quoted 64 lines · Benny Halevy
Quoted 63 lines · Trond Myklebust
Quoted 50 lines · Benny Halevy
Quoted 34 lines · Trond Myklebust
Quoted 19 lines · Benny Halevy
I think the following should work:
Benny
git diff --stat -p -M
fs/nfs/nfs4filelayout.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)fs/nfs/nfs4filelayout.c +2
-0@@ -661,6 +661,16 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, u64 p_stripe, r_stripe;u32 stripe_unit; +/* +* FIXME: ideally we should be able to coalesce all requests fs/nfs/nfs4filelayout.c filelayout_pg_test(struct nfs_pageio_descriptor · line 676
Quoted 10 lines
fs/nfs/nfs4filelayout.c +8
-0+* that are not block boundary aligned, but currently this +* is problematic for the case of bsize < PAGE_CACHE_SIZE, +* since nfs_flush_multi and nfs_pagein_multi assume you +* can have only one struct nfs_page. +*/ +if (desc->pg_bsize <PAGE_SIZE ) +return 0 ; +if (!pnfs_generic_pg_test (pgio, prev, req))return 0 ;So, there are several things that bother me about
pnfs_generic_pg_test()too now that I'm looking more closely at it:Quoted 14 lines
1. If the intention is to coalesce 'prev' and 'req', shouldn't we be asking for a layout with
req_offset(prev)instead ofreq_offset(req)?
2. If we're only requesting a layout of lengthpg_count, don't we still need to test the layout length that the server actually returned before we can allow the coalescing?
3. if (!pgio->lseg), shouldn't we be returning an error of some sort? Right now we're returning 'true', and allowing the coalesce to occur.
4. Furthermore, shouldn't that test guarding thepnfs_update_layout()call rather be an 'if (pgio->pg_lseg== NULL)' instead of looking at the values ofpg_countandprev->wb_bytes?Quoted 2 lines
or rather we get the layout for the first page in
nfs_pageio_do_add_requestwhendesc->pg_count== 0?I can live with a
desc->pg_init()callback or rather, convertingpg_test()andpg_doio()into astruct nfs_pageio_ops { int (*pg_init)(struct nfs_pageio_descriptor *desc, struct nfs_page *req); bool (*pg_test)(struct nfs_pageio_descriptor *desc, struct nfs_page *prev, struct nfs_page *req); int (*pg_doio)(struct nfs_pageio_descriptor *desc); };
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
and then replacing the two callback functions in the existing struct
nfs_pageio_descriptorwith a single pointer to a 'const structnfs_pageio_ops'...looks like a good way to do this!
Is anyone coding this fix?
I started working on this but switched to porting forward spnfs and spnfs-block (which I've just pushed out).
Benny
Quoted 22 lines
-->Andy
Quoted 10 lines
Quoted 9 lines
Quoted 5 lines
Then, this lseg would be useful for
nfs_flush_multiif we failed to coalesce, or we failed to get a layout altogether we go the nfs path and can resetpg_testtonfs_generic_pg_test.It would presumably also get rid of all those
pnfs_update_layout()calls inread.candwrite.c.Quoted 6 lines
Yup.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
I'm working on it. I'm doing a lot of surgery in that general area anyway...
-----Original Message-----
From: Benny Halevy [mailto:[email protected]]
Sent: Monday, June 06, 2011 2:21 PM
To: William A. (Andy) Adamson
Cc: Myklebust, Trond; Adamson, Dros; Boaz Harrosh; Myklebust, Trond; [email protected]
Subject: Re: [PATCH] NFS: filelayout should use nfs_generic_pg_test
Quoted 1 line · William A. (Andy) Adamson
On Wed, Jun 1, 2011 at 4:09 PM, Benny Halevy <[email protected]>
Quoted 12 lines · wrote:
Quoted 12 lines · Trond Myklebust
Quoted 11 lines · Benny Halevy
Quoted 10 lines · Trond Myklebust
Quoted 9 lines · Benny Halevy
Quoted 8 lines
I think the following should work:
Benny
git diff --stat -p -M
fs/nfs/nfs4filelayout.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
fs/nfs/nfs4filelayout.c filelayout_pg_test(struct
Quoted 5 lines
fs/nfs/nfs4filelayout.c +0
-0@@ -661,6 +661,16 @@ filelayout_pg_test(struct
nfs_pageio_descriptor
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 16 lines
fs/nfs/nfs4filelayout.c +10
-0*pgio, struct nfs_page *prev, u64 p_stripe, r_stripe;u32 stripe_unit; +/* +* FIXME: ideally we should be able to coalesce all requests +* that are not block boundary aligned, but currently this +* is problematic for the case of bsize < PAGE_CACHE_SIZE, +* since nfs_flush_multi and nfs_pagein_multi assume you +* can have only one struct nfs_page. +*/ +if (desc->pg_bsize <PAGE_SIZE ) +return 0 ; +if (!pnfs_generic_pg_test (pgio, prev, req))return 0 ;
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
So, there are several things that bother me about
pnfs_generic_pg_test()
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
too now that I'm looking more closely at it:
1. If the intention is to coalesce 'prev' and 'req',
shouldn't we
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
be asking for a layout with
req_offset(prev)instead ofreq_offset(req)?
2. If we're only requesting a layout of lengthpg_count,
don't we
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
still need to test the layout length that the server
actually
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
returned before we can allow the coalescing?
3. if (!pgio->lseg), shouldn't we be returning an error of
some
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
sort? Right now we're returning 'true', and allowing the coalesce to occur.
4. Furthermore, shouldn't that test guarding thepnfs_update_layout()call rather be an 'if (pgio->pg_lseg
==
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
NULL)' instead of looking at the values of
pg_countandprev->wb_bytes?
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
or rather we get the layout for the first page in
nfs_pageio_do_add_requestwhendesc->pg_count== 0?I can live with a
desc->pg_init()callback or rather, convertingpg_test()andpg_doio()into astruct
nfs_pageio_ops{
int (*pg_init)(structnfs_pageio_descriptor*desc, struct
nfs_page *req);
Quoted 1 line
Quoted 1 line
Quoted 1 line
bool (*pg_test)(struct
nfs_pageio_descriptor*desc, struct
nfs_page *prev, struct nfs_page *req);
Quoted 12 lines
Quoted 9 lines
Quoted 7 lines
int (*pg_doio)(struct nfs_pageio_descriptor *desc); };and then replacing the two callback functions in the existing struct
nfs_pageio_descriptorwith a single pointer to a 'const structnfs_pageio_ops'...looks like a good way to do this!
Is anyone coding this fix?
I started working on this but switched to porting forward spnfs and spnfs-block (which I've just pushed out).
Benny
Quoted 9 lines
-->Andy
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Then, this lseg would be useful for
nfs_flush_multiif we failed to coalesce, or we failed to get a layout altogether we go the nfs path and can resetpg_testtonfs_generic_pg_test.It would presumably also get rid of all those
pnfs_update_layout()
calls
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
in
read.candwrite.c.Yup.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs"
in
Quoted 5 lines
Quoted 3 lines
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe linux-nfs"
in
Quoted 2 lines
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html