Whamcloud - gitweb
LU-2139 osc: Use SOFT_SYNC to urge server commit
[fs/lustre-release.git] / lustre / osc / osc_cache.c
index df3dec4..4d97b3e 100644 (file)
@@ -1804,6 +1804,9 @@ void osc_dec_unstable_pages(struct ptlrpc_request *req)
        cfs_atomic_sub(page_count, &cli->cl_cache->ccc_unstable_nr);
        LASSERT(cfs_atomic_read(&cli->cl_cache->ccc_unstable_nr) >= 0);
 
        cfs_atomic_sub(page_count, &cli->cl_cache->ccc_unstable_nr);
        LASSERT(cfs_atomic_read(&cli->cl_cache->ccc_unstable_nr) >= 0);
 
+       cfs_atomic_sub(page_count, &cli->cl_unstable_count);
+       LASSERT(cfs_atomic_read(&cli->cl_unstable_count) >= 0);
+
        cfs_atomic_sub(page_count, &obd_unstable_pages);
        LASSERT(cfs_atomic_read(&obd_unstable_pages) >= 0);
 
        cfs_atomic_sub(page_count, &obd_unstable_pages);
        LASSERT(cfs_atomic_read(&obd_unstable_pages) >= 0);
 
@@ -1835,6 +1838,9 @@ void osc_inc_unstable_pages(struct ptlrpc_request *req)
        LASSERT(cfs_atomic_read(&cli->cl_cache->ccc_unstable_nr) >= 0);
        cfs_atomic_add(page_count, &cli->cl_cache->ccc_unstable_nr);
 
        LASSERT(cfs_atomic_read(&cli->cl_cache->ccc_unstable_nr) >= 0);
        cfs_atomic_add(page_count, &cli->cl_cache->ccc_unstable_nr);
 
+       LASSERT(cfs_atomic_read(&cli->cl_unstable_count) >= 0);
+       cfs_atomic_add(page_count, &cli->cl_unstable_count);
+
        LASSERT(cfs_atomic_read(&obd_unstable_pages) >= 0);
        cfs_atomic_add(page_count, &obd_unstable_pages);
 
        LASSERT(cfs_atomic_read(&obd_unstable_pages) >= 0);
        cfs_atomic_add(page_count, &obd_unstable_pages);
 
@@ -2361,6 +2367,9 @@ int osc_queue_async_io(const struct lu_env *env, struct cl_io *io,
                        RETURN(rc);
        }
 
                        RETURN(rc);
        }
 
+       if (osc_over_unstable_soft_limit(cli))
+               brw_flags |= OBD_BRW_SOFT_SYNC;
+
        oap->oap_cmd = cmd;
        oap->oap_page_off = ops->ops_from;
        oap->oap_count = ops->ops_to - ops->ops_from;
        oap->oap_cmd = cmd;
        oap->oap_page_off = ops->ops_from;
        oap->oap_count = ops->ops_to - ops->ops_from;