Whamcloud - gitweb
LU-12820 osc: remove 'transient' arg from osc_enter_cache_try 19/36319/3
authorMr NeilBrown <neilb@suse.de>
Sun, 29 Sep 2019 23:09:54 +0000 (09:09 +1000)
committerOleg Drokin <green@whamcloud.com>
Sat, 14 Dec 2019 05:59:26 +0000 (05:59 +0000)
This arg is always '0', so remove it.
Consequently, OBD_BRW_NOCACHE is never set, and
cl_dirty_transit and obd_dirty_transit_pages
are never non-zero.
So they can be removed as well.

Linux-commit: 8d1057264a75

Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Ia047affc33fb9277e6c28a8f6d7d088c385b51a8
Reviewed-on: https://review.whamcloud.com/36319
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Shaun Tancheff <stancheff@cray.com>
Reviewed-by: Ben Evans <bevans@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/obd.h
lustre/include/obd_support.h
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/obdclass/class_obd.c
lustre/osc/osc_cache.c
lustre/osc/osc_request.c

index 96c77a0..56b2e39 100644 (file)
@@ -212,7 +212,6 @@ struct client_obd {
        /* the grant values are protected by loi_list_lock below */
        unsigned long            cl_dirty_pages;      /* all _dirty_ in pages */
        unsigned long            cl_dirty_max_pages;  /* allowed w/o rpc */
-       unsigned long            cl_dirty_transit;    /* dirty synchronous */
        unsigned long            cl_avail_grant;   /* bytes of credit for ost */
        unsigned long            cl_lost_grant;    /* lost credits (trunc) */
        /* grant consumed for dirty pages */
index 6e11bd8..8a0f778 100644 (file)
@@ -68,7 +68,6 @@ extern int at_early_margin;
 extern int at_extra;
 extern unsigned long obd_max_dirty_pages;
 extern atomic_long_t obd_dirty_pages;
-extern atomic_long_t obd_dirty_transit_pages;
 extern char obd_jobid_var[];
 
 /* Some hash init argument constants */
index 5b02ad3..2d59f67 100644 (file)
@@ -1358,6 +1358,7 @@ struct hsm_state_set {
 #define OBD_BRW_CHECK           0x10
 #define OBD_BRW_FROM_GRANT      0x20 /* the osc manages this under llite */
 #define OBD_BRW_GRANTED         0x40 /* the ost manages this */
+/* OBD_BRW_NOCACHE is currently neither set nor tested */
 #define OBD_BRW_NOCACHE         0x80 /* this page is a part of non-cached IO */
 #define OBD_BRW_NOQUOTA        0x100
 #define OBD_BRW_SRVLOCK        0x200 /* Client holds no lock over this page */
index 5eee8ef..703025f 100644 (file)
@@ -98,9 +98,6 @@ EXPORT_SYMBOL(at_early_margin);
 int at_extra = 30;
 EXPORT_SYMBOL(at_extra);
 
-atomic_long_t obd_dirty_transit_pages;
-EXPORT_SYMBOL(obd_dirty_transit_pages);
-
 #ifdef CONFIG_PROC_FS
 struct lprocfs_stats *obd_memory = NULL;
 EXPORT_SYMBOL(obd_memory);
index 891d560..05f0c61 100644 (file)
@@ -1427,11 +1427,6 @@ static void osc_release_write_grant(struct client_obd *cli,
        pga->flag &= ~OBD_BRW_FROM_GRANT;
        atomic_long_dec(&obd_dirty_pages);
        cli->cl_dirty_pages--;
-       if (pga->flag & OBD_BRW_NOCACHE) {
-               pga->flag &= ~OBD_BRW_NOCACHE;
-               atomic_long_dec(&obd_dirty_transit_pages);
-               cli->cl_dirty_transit--;
-       }
        EXIT;
 }
 
@@ -1544,7 +1539,7 @@ static void osc_exit_cache(struct client_obd *cli, struct osc_async_page *oap)
  */
 static int osc_enter_cache_try(struct client_obd *cli,
                               struct osc_async_page *oap,
-                              int bytes, int transient)
+                              int bytes)
 {
        int rc;
 
@@ -1558,11 +1553,6 @@ static int osc_enter_cache_try(struct client_obd *cli,
                if (atomic_long_add_return(1, &obd_dirty_pages) <=
                    obd_max_dirty_pages) {
                        osc_consume_write_grant(cli, &oap->oap_brw_page);
-                       if (transient) {
-                               cli->cl_dirty_transit++;
-                               atomic_long_inc(&obd_dirty_transit_pages);
-                               oap->oap_brw_flags |= OBD_BRW_NOCACHE;
-                       }
                        rc = 1;
                        goto out;
                } else
@@ -1618,7 +1608,7 @@ static int osc_enter_cache(const struct lu_env *env, struct client_obd *cli,
 
        /* Hopefully normal case - cache space and write credits available */
        if (list_empty(&cli->cl_cache_waiters) &&
-           osc_enter_cache_try(cli, oap, bytes, 0)) {
+           osc_enter_cache_try(cli, oap, bytes)) {
                OSC_DUMP_GRANT(D_CACHE, cli, "granted from cache\n");
                GOTO(out, rc = 0);
        }
@@ -1656,7 +1646,7 @@ static int osc_enter_cache(const struct lu_env *env, struct client_obd *cli,
 
                if (rc != -EDQUOT)
                        break;
-               if (osc_enter_cache_try(cli, oap, bytes, 0)) {
+               if (osc_enter_cache_try(cli, oap, bytes)) {
                        rc = 0;
                        break;
                }
@@ -1706,7 +1696,7 @@ void osc_wake_cache_waiters(struct client_obd *cli)
 
                ocw->ocw_rc = -EDQUOT;
 
-               if (osc_enter_cache_try(cli, ocw->ocw_oap, ocw->ocw_grant, 0))
+               if (osc_enter_cache_try(cli, ocw->ocw_oap, ocw->ocw_grant))
                        ocw->ocw_rc = 0;
 
                if (ocw->ocw_rc == 0 ||
@@ -2440,7 +2430,7 @@ int osc_queue_async_io(const struct lu_env *env, struct cl_io *io,
 
                /* it doesn't need any grant to dirty this page */
                spin_lock(&cli->cl_loi_list_lock);
-               rc = osc_enter_cache_try(cli, oap, grants, 0);
+               rc = osc_enter_cache_try(cli, oap, grants);
                if (rc == 0) { /* try failed */
                        grants = 0;
                        need_release = 1;
index 0e0092d..7a0a550 100644 (file)
@@ -645,21 +645,18 @@ static void osc_announce_cached(struct client_obd *cli, struct obdo *oa,
                oa->o_dirty = cli->cl_dirty_grant;
        else
                oa->o_dirty = cli->cl_dirty_pages << PAGE_SHIFT;
-       if (unlikely(cli->cl_dirty_pages - cli->cl_dirty_transit >
-                    cli->cl_dirty_max_pages)) {
-               CERROR("dirty %lu - %lu > dirty_max %lu\n",
-                      cli->cl_dirty_pages, cli->cl_dirty_transit,
+       if (unlikely(cli->cl_dirty_pages > cli->cl_dirty_max_pages)) {
+               CERROR("dirty %lu > dirty_max %lu\n",
+                      cli->cl_dirty_pages,
                       cli->cl_dirty_max_pages);
                oa->o_undirty = 0;
-       } else if (unlikely(atomic_long_read(&obd_dirty_pages) -
-                           atomic_long_read(&obd_dirty_transit_pages) >
+       } else if (unlikely(atomic_long_read(&obd_dirty_pages) >
                            (long)(obd_max_dirty_pages + 1))) {
                /* The atomic_read() allowing the atomic_inc() are
                 * not covered by a lock thus they may safely race and trip
                 * this CERROR() unless we add in a small fudge factor (+1). */
-               CERROR("%s: dirty %ld - %ld > system dirty_max %ld\n",
+               CERROR("%s: dirty %ld > system dirty_max %ld\n",
                       cli_name(cli), atomic_long_read(&obd_dirty_pages),
-                      atomic_long_read(&obd_dirty_transit_pages),
                       obd_max_dirty_pages);
                oa->o_undirty = 0;
        } else if (unlikely(cli->cl_dirty_max_pages - cli->cl_dirty_pages >