Commit 5196e42c authored by Jinshan Xiong's avatar Jinshan Xiong Committed by Greg Kroah-Hartman
Browse files

staging/lustre/osc: Adjustment on osc LRU for performance



Add and discard pages from LRU in batch.

Signed-off-by: default avatarJinshan Xiong <jinshan.xiong@intel.com>
Reviewed-on: http://review.whamcloud.com/7890
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3321


Reviewed-by: default avatarNiu Yawei <yawei.niu@intel.com>
Reviewed-by: default avatarLai Siyao <lai.siyao@intel.com>
Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 26f98e82
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -85,10 +85,7 @@ static struct ll_sb_info *ll_init_sbi(struct super_block *sb)

	si_meminfo(&si);
	pages = si.totalram - si.totalhigh;
	if (pages >> (20 - PAGE_CACHE_SHIFT) < 512)
	lru_page_max = pages / 2;
	else
		lru_page_max = (pages / 4) * 3;

	/* initialize lru data */
	atomic_set(&sbi->ll_cache.ccc_users, 0);
+1 −1
Original line number Diff line number Diff line
@@ -223,7 +223,7 @@ static ssize_t osc_cached_mb_seq_write(struct file *file,

	rc = atomic_read(&cli->cl_lru_in_list) - pages_number;
	if (rc > 0)
		(void)osc_lru_shrink(cli, rc);
		(void)osc_lru_shrink(cli, rc, true);

	return count;
}
+2 −0
Original line number Diff line number Diff line
@@ -856,6 +856,8 @@ int osc_extent_finish(const struct lu_env *env, struct osc_extent *ext,

	ext->oe_rc = rc ?: ext->oe_nr_pages;
	EASSERT(ergo(rc == 0, ext->oe_state == OES_RPC), ext);

	osc_lru_add_batch(cli, &ext->oe_pages);
	list_for_each_entry_safe(oap, tmp, &ext->oe_pages, oap_pending_item) {
		list_del_init(&oap->oap_rpc_item);
		list_del_init(&oap->oap_pending_item);
+13 −13
Original line number Diff line number Diff line
@@ -77,6 +77,8 @@ struct osc_io {
	 */
	struct osc_extent *oi_trunc;

	int oi_lru_reserved;

	struct obd_info    oi_info;
	struct obdo	oi_oa;
	struct osc_async_cbargs {
@@ -100,7 +102,7 @@ struct osc_session {
	struct osc_io       os_io;
};

#define OTI_PVEC_SIZE 64
#define OTI_PVEC_SIZE 256
struct osc_thread_info {
	struct ldlm_res_id      oti_resname;
	ldlm_policy_data_t      oti_policy;
@@ -369,10 +371,8 @@ struct osc_page {
	 * Set if the page must be transferred with OBD_BRW_SRVLOCK.
	 */
			      ops_srvlock:1;
	union {
	/**
		 * lru page list. ops_inflight and ops_lru are exclusive so
		 * that they can share the same data.
	 * lru page list. See osc_lru_{del|use}() in osc_page.c for usage.
	 */
	struct list_head	      ops_lru;
	/**
@@ -380,7 +380,6 @@ struct osc_page {
	 * debugging.
	 */
	struct list_head	    ops_inflight;
	};
	/**
	 * Thread that submitted this page for transfer. For debugging.
	 */
@@ -432,6 +431,7 @@ void osc_index2policy (ldlm_policy_data_t *policy, const struct cl_object *obj,
int  osc_lvb_print     (const struct lu_env *env, void *cookie,
			lu_printer_t p, const struct ost_lvb *lvb);

void osc_lru_add_batch(struct client_obd *cli, struct list_head *list);
void osc_page_submit(const struct lu_env *env, struct osc_page *opg,
		     enum cl_req_type crt, int brw_flags);
int osc_cancel_async_page(const struct lu_env *env, struct osc_page *ops);
+2 −1
Original line number Diff line number Diff line
@@ -130,7 +130,8 @@ int osc_sync_base(struct obd_export *exp, struct obd_info *oinfo,
int osc_process_config_base(struct obd_device *obd, struct lustre_cfg *cfg);
int osc_build_rpc(const struct lu_env *env, struct client_obd *cli,
		  struct list_head *ext_list, int cmd);
int osc_lru_shrink(struct client_obd *cli, int target);
int osc_lru_shrink(struct client_obd *cli, int target, bool force);
int osc_lru_reclaim(struct client_obd *cli);

extern spinlock_t osc_ast_guard;

Loading