Commit 524deb6f authored by Mr NeilBrown's avatar Mr NeilBrown Committed by Oleg Drokin
Browse files

LU-12820 osc: remove 'transient' arg from osc_enter_cache_try



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: default avatarMr NeilBrown <neilb@suse.de>
Change-Id: Ia047affc33fb9277e6c28a8f6d7d088c385b51a8
Reviewed-on: https://review.whamcloud.com/36319

Tested-by: default avatarjenkins <devops@whamcloud.com>
Tested-by: default avatarMaloo <maloo@whamcloud.com>
Reviewed-by: default avatarJames Simmons <jsimmons@infradead.org>
Reviewed-by: default avatarShaun Tancheff <stancheff@cray.com>
Reviewed-by: default avatarBen Evans <bevans@cray.com>
Reviewed-by: default avatarOleg Drokin <green@whamcloud.com>
parent d234e2cf
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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);
......
......@@ -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;
......
......@@ -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 >
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment