Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1367429
| From | green@linuxhacker.ru |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 43/43] staging/lustre/ldlm: restore the ELC for enqueue |
| Date | 2016-03-30 19:00 +0200 |
| Message-ID | <rirDk-8fh-11@gated-at.bofh.it> (permalink) |
| References | <rirtD-8bi-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Vitaly Fertman <vitaly.fertman@seagate.com>
after LU-4300 enqueue does not ELC anymore, however if enqueue is
agressive (ls -la of a large dir) we may exceed lru-resize limit
quickly because LRUR shrinker and recalc are called not so often.
ELC is to be restored in enqueue.
ELC also should check for the lock weight, in addition to LRUR.
ELC can also keep "skipped" locks, i.e. once checked for the weight
and left in the lru - let LRUR take care about them later.
LRUR is to be left untouched, no weight logic, otherwise LU-5727
appears and OPEN locks do not get canceled.
Xyratex-bug-id: MRP-2550
Signed-off-by: Vitaly Fertman <vitaly.fertman@seagate.com>
Reviewed-on: http://review.whamcloud.com/14342
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6390
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 7 +++---
drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 25 ++++++++++++++++++----
drivers/staging/lustre/lustre/osc/osc_request.c | 4 ++--
3 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
index e21373e..e31d84a 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
@@ -95,9 +95,10 @@ enum {
LDLM_CANCEL_PASSED = 1 << 1, /* Cancel passed number of locks. */
LDLM_CANCEL_SHRINK = 1 << 2, /* Cancel locks from shrinker. */
LDLM_CANCEL_LRUR = 1 << 3, /* Cancel locks from lru resize. */
- LDLM_CANCEL_NO_WAIT = 1 << 4 /* Cancel locks w/o blocking (neither
- * sending nor waiting for any rpcs)
- */
+ LDLM_CANCEL_NO_WAIT = 1 << 4, /* Cancel locks w/o blocking (neither
+ * sending nor waiting for any rpcs)
+ */
+ LDLM_CANCEL_LRUR_NO_WAIT = 1 << 5, /* LRUR + NO_WAIT */
};
int ldlm_cancel_lru(struct ldlm_namespace *ns, int nr,
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
index 48e9828..9aa4c2d 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
@@ -601,7 +601,7 @@ int ldlm_prep_elc_req(struct obd_export *exp, struct ptlrpc_request *req,
avail = ldlm_capsule_handles_avail(pill, RCL_CLIENT, canceloff);
flags = ns_connect_lru_resize(ns) ?
- LDLM_CANCEL_LRUR : LDLM_CANCEL_AGED;
+ LDLM_CANCEL_LRUR_NO_WAIT : LDLM_CANCEL_AGED;
to_free = !ns_connect_lru_resize(ns) &&
opc == LDLM_ENQUEUE ? 1 : 0;
@@ -1146,7 +1146,7 @@ static ldlm_policy_res_t ldlm_cancel_no_wait_policy(struct ldlm_namespace *ns,
switch (lock->l_resource->lr_type) {
case LDLM_EXTENT:
case LDLM_IBITS:
- if (ns->ns_cancel && ns->ns_cancel(lock) != 0)
+ if (ns->ns_cancel && ns->ns_cancel(lock) != 0)
break;
default:
result = LDLM_POLICY_SKIP_LOCK;
@@ -1251,6 +1251,21 @@ static ldlm_policy_res_t ldlm_cancel_aged_policy(struct ldlm_namespace *ns,
return LDLM_POLICY_CANCEL_LOCK;
}
+static ldlm_policy_res_t
+ldlm_cancel_lrur_no_wait_policy(struct ldlm_namespace *ns,
+ struct ldlm_lock *lock,
+ int unused, int added,
+ int count)
+{
+ ldlm_policy_res_t result;
+
+ result = ldlm_cancel_lrur_policy(ns, lock, unused, added, count);
+ if (result == LDLM_POLICY_KEEP_LOCK)
+ return result;
+
+ return ldlm_cancel_no_wait_policy(ns, lock, unused, added, count);
+}
+
/**
* Callback function for default policy. Makes decision whether to keep \a lock
* in LRU for current LRU size \a unused, added in current scan \a added and
@@ -1290,6 +1305,8 @@ ldlm_cancel_lru_policy(struct ldlm_namespace *ns, int flags)
return ldlm_cancel_lrur_policy;
else if (flags & LDLM_CANCEL_PASSED)
return ldlm_cancel_passed_policy;
+ else if (flags & LDLM_CANCEL_LRUR_NO_WAIT)
+ return ldlm_cancel_lrur_no_wait_policy;
} else {
if (flags & LDLM_CANCEL_AGED)
return ldlm_cancel_aged_policy;
@@ -1338,6 +1355,7 @@ static int ldlm_prepare_lru_list(struct ldlm_namespace *ns,
ldlm_cancel_lru_policy_t pf;
struct ldlm_lock *lock, *next;
int added = 0, unused, remained;
+ int no_wait = flags & (LDLM_CANCEL_NO_WAIT | LDLM_CANCEL_LRUR_NO_WAIT);
spin_lock(&ns->ns_lock);
unused = ns->ns_nr_unused;
@@ -1365,8 +1383,7 @@ static int ldlm_prepare_lru_list(struct ldlm_namespace *ns,
/* No locks which got blocking requests. */
LASSERT(!(lock->l_flags & LDLM_FL_BL_AST));
- if (flags & LDLM_CANCEL_NO_WAIT &&
- lock->l_flags & LDLM_FL_SKIPPED)
+ if (no_wait && lock->l_flags & LDLM_FL_SKIPPED)
/* already processed */
continue;
diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c
index a6dc517..5b9f72c 100644
--- a/drivers/staging/lustre/lustre/osc/osc_request.c
+++ b/drivers/staging/lustre/lustre/osc/osc_request.c
@@ -2297,8 +2297,8 @@ no_match:
if (!req)
return -ENOMEM;
- rc = ptlrpc_request_pack(req, LUSTRE_DLM_VERSION, LDLM_ENQUEUE);
- if (rc < 0) {
+ rc = ldlm_prep_enqueue_req(exp, req, NULL, 0);
+ if (rc) {
ptlrpc_request_free(req);
return rc;
}
--
2.1.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/43] Lustre IO stack simplifications and cleanups green@linuxhacker.ru - 2016-03-30 18:50 +0200
[PATCH 04/43] staging/lustre: Reintroduce global env list green@linuxhacker.ru - 2016-03-30 18:50 +0200
[PATCH 10/43] staging/lustre/osc: add weight function for DLM lock green@linuxhacker.ru - 2016-03-30 18:50 +0200
[PATCH 20/43] staging/lustre: update comments after cl_lock simplification green@linuxhacker.ru - 2016-03-30 18:50 +0200
[PATCH 02/43] staging/lustre: Get rid of CFS_PAGE_MASK green@linuxhacker.ru - 2016-03-30 18:50 +0200
[PATCH 17/43] staging/lustre: Remove struct ll_iattr green@linuxhacker.ru - 2016-03-30 18:50 +0200
[PATCH 08/43] staging/lustre/obdclass: Add a preallocated percpu cl_env green@linuxhacker.ru - 2016-03-30 18:50 +0200
[PATCH 25/43] staging/lustre/llite: rename ccc_device to vvp_device green@linuxhacker.ru - 2016-03-30 19:00 +0200
[PATCH 28/43] staging/lustre/llite: rename ccc_lock to vvp_lock green@linuxhacker.ru - 2016-03-30 19:00 +0200
[PATCH 43/43] staging/lustre/ldlm: restore the ELC for enqueue green@linuxhacker.ru - 2016-03-30 19:00 +0200
[PATCH 31/43] staging/lustre/llite: use vui prefix for struct vvp_io members green@linuxhacker.ru - 2016-03-30 19:00 +0200
[PATCH 15/43] staging/lustre/obd: remove struct client_obd_lock green@linuxhacker.ru - 2016-03-30 19:00 +0200
[PATCH 30/43] staging/lustre/llite: merge ccc_io and vvp_io green@linuxhacker.ru - 2016-03-30 19:00 +0200
[PATCH 29/43] staging/lustre:llite: remove struct ll_ra_read green@linuxhacker.ru - 2016-03-30 19:00 +0200
[PATCH 37/43] staging/lustre/llite: Remove ccc_global_{init,fini}() green@linuxhacker.ru - 2016-03-30 19:00 +0200
[PATCH 38/43] staging/lustre/llite: Move ll_dirent_type_get and make it static green@linuxhacker.ru - 2016-03-30 19:00 +0200
[PATCH 16/43] staging/lustre/llite: remove some cl wrappers green@linuxhacker.ru - 2016-03-30 19:00 +0200
[PATCH 27/43] staging/lustre/llite: rename ccc_page to vvp_page green@linuxhacker.ru - 2016-03-30 19:00 +0200
[PATCH 41/43] staging/lustre/ldlm: ELC picks locks in a safer policy green@linuxhacker.ru - 2016-03-30 19:00 +0200
[PATCH 32/43] staging/lustre/llite: move vvp_io functions to vvp_io.c green@linuxhacker.ru - 2016-03-30 19:00 +0200
[PATCH 40/43] staging/lustre/llite: Remove unused vui_local_lock field green@linuxhacker.ru - 2016-03-30 19:00 +0200
[PATCH 42/43] staging/lustre/ldlm: revert changes to ldlm_cancel_aged_policy() green@linuxhacker.ru - 2016-03-30 19:00 +0200
[PATCH 33/43] staging/lustre/llite: rename ccc_req to vvp_req green@linuxhacker.ru - 2016-03-30 19:00 +0200
[PATCH 36/43] staging/lustre/llite: rename struct ccc_thread_info to vvp_thread_info green@linuxhacker.ru - 2016-03-30 19:00 +0200
[PATCH 23/43] staging/lustre/llite: make sure we do cl_page_clip on the last page green@linuxhacker.ru - 2016-03-30 19:00 +0200
[PATCH 14/43] staging/lustre/lmv: remove lmv_init_{lock,unlock}() green@linuxhacker.ru - 2016-03-30 19:00 +0200
[PATCH 22/43] staging/lustre/llite: deadlock for page write green@linuxhacker.ru - 2016-03-30 19:00 +0200
[PATCH 18/43] staging/lustre/clio: generalize cl_sync_io green@linuxhacker.ru - 2016-03-30 19:00 +0200
[PATCH 39/43] staging/lustre/llite: Move several declarations to llite_internal.h green@linuxhacker.ru - 2016-03-30 19:00 +0200
[PATCH 35/43] staging/lustre/llite: Rename struct vvp_thread_info to ll_thread_info green@linuxhacker.ru - 2016-03-30 19:00 +0200
[PATCH 34/43] staging/lustre/llite: Rename struct ccc_grouplock to ll_grouplock green@linuxhacker.ru - 2016-03-30 19:00 +0200
[PATCH 24/43] staging/lustre/llite: merge lclient.h into llite/vvp_internal.h green@linuxhacker.ru - 2016-03-30 19:00 +0200
[PATCH 21/43] staging/lustre/llite: clip page correctly for vvp_io_commit_sync green@linuxhacker.ru - 2016-03-30 19:00 +0200
[PATCH 12/43] staging/lustre/clio: optimize read ahead code green@linuxhacker.ru - 2016-03-30 19:10 +0200
[PATCH 05/43] staging/lustre/osc: Adjustment on osc LRU for performance green@linuxhacker.ru - 2016-03-30 19:10 +0200
[PATCH 13/43] staging/lustre/llite: remove lli_lvb green@linuxhacker.ru - 2016-03-30 19:10 +0200
[PATCH 06/43] staging/lustre/osc: to drop LRU pages with cl_lru_work green@linuxhacker.ru - 2016-03-30 19:10 +0200
csiph-web