aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2018-03-06 02:14:54 -0500
committerIlya Dryomov <idryomov@gmail.com>2018-04-02 04:12:48 -0400
commit1582af2eaaf17cbcd7864172347c1db10b6b2210 (patch)
treea51d6c8069b3a030b5d7fec0f1aa2d7f2aad5b8e /fs/ceph
parentaf9cc401ce7452f9d965ba4553d8ffe7f0ed42ee (diff)
ceph: don't wait on writeback when there is no more dirty pages
In sync mode, writepages() needs to write all dirty pages. But it can only write dirty pages associated with the oldest snapc. To write dirty pages associated with next snapc, it needs to wait until current writes complete. If there is no more dirty pages, writepages() should not wait on writeback. Otherwise, dirty page writeback becomes very slow. Signed-off-by: "Yan, Zheng" <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/addr.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 3376822a624e..5f7ad3d0df2e 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -857,7 +857,7 @@ retry:
857 * in that range can be associated with newer snapc. 857 * in that range can be associated with newer snapc.
858 * They are not writeable until we write all dirty pages 858 * They are not writeable until we write all dirty pages
859 * associated with 'snapc' get written */ 859 * associated with 'snapc' get written */
860 if (index > 0 || wbc->sync_mode != WB_SYNC_NONE) 860 if (index > 0)
861 should_loop = true; 861 should_loop = true;
862 dout(" non-head snapc, range whole\n"); 862 dout(" non-head snapc, range whole\n");
863 } 863 }
@@ -903,6 +903,10 @@ get_more_pages:
903 if (pgsnapc != snapc) { 903 if (pgsnapc != snapc) {
904 dout("page snapc %p %lld != oldest %p %lld\n", 904 dout("page snapc %p %lld != oldest %p %lld\n",
905 pgsnapc, pgsnapc->seq, snapc, snapc->seq); 905 pgsnapc, pgsnapc->seq, snapc, snapc->seq);
906 if (!should_loop &&
907 !ceph_wbc.head_snapc &&
908 wbc->sync_mode != WB_SYNC_NONE)
909 should_loop = true;
906 unlock_page(page); 910 unlock_page(page);
907 continue; 911 continue;
908 } 912 }