Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1427054
| From | Oleg Drokin <green@linuxhacker.ru> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 05/29] staging/lustre/osc: osc_lock_weight endless loop fix |
| Date | 2016-06-20 23:20 +0200 |
| Message-ID | <rMeLT-52j-5@gated-at.bofh.it> (permalink) |
| References | <rMesx-4Gc-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Jinshan Xiong <jinshan.xiong@intel.com>
With huge number of pages to scan by osc_lock_weight() it is likely
CLP_GANG_RESCHED is returned from osc_page_gang_lookup() and the scan
will be repeated again from the start. To be sure that the scan is
progressing across those restarts, next scan should be started from
the last scanned page index plus one.
Xyratex-bug-id: MRP-2145
Signed-off-by: Alexander Zarochentsev <alexander.zarochentsev@seagate.com>
Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-on: http://review.whamcloud.com/12362
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5781
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
drivers/staging/lustre/lustre/osc/osc_lock.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/lustre/lustre/osc/osc_lock.c b/drivers/staging/lustre/lustre/osc/osc_lock.c
index 42def38..d856775 100644
--- a/drivers/staging/lustre/lustre/osc/osc_lock.c
+++ b/drivers/staging/lustre/lustre/osc/osc_lock.c
@@ -634,11 +634,10 @@ static int weigh_cb(const struct lu_env *env, struct cl_io *io,
if (cl_page_is_vmlocked(env, page) ||
PageDirty(page->cp_vmpage) || PageWriteback(page->cp_vmpage)
- ) {
- (*(unsigned long *)cbdata)++;
+ )
return CLP_GANG_ABORT;
- }
+ *(pgoff_t *)cbdata = osc_index(ops) + 1;
return CLP_GANG_OKAY;
}
@@ -648,7 +647,7 @@ static unsigned long osc_lock_weight(const struct lu_env *env,
{
struct cl_io *io = &osc_env_info(env)->oti_io;
struct cl_object *obj = cl_object_top(&oscobj->oo_cl);
- unsigned long npages = 0;
+ pgoff_t page_index;
int result;
io->ci_obj = obj;
@@ -657,11 +656,12 @@ static unsigned long osc_lock_weight(const struct lu_env *env,
if (result != 0)
return result;
+ page_index = cl_index(obj, extent->start);
do {
result = osc_page_gang_lookup(env, io, oscobj,
- cl_index(obj, extent->start),
+ page_index,
cl_index(obj, extent->end),
- weigh_cb, (void *)&npages);
+ weigh_cb, (void *)&page_index);
if (result == CLP_GANG_ABORT)
break;
if (result == CLP_GANG_RESCHED)
@@ -669,7 +669,7 @@ static unsigned long osc_lock_weight(const struct lu_env *env,
} while (result != CLP_GANG_OKAY);
cl_io_fini(env, io);
- return npages;
+ return result == CLP_GANG_ABORT ? 1 : 0;
}
/**
--
2.7.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 00/29] Lustre fixes Oleg Drokin <green@linuxhacker.ru> - 2016-06-20 23:10 +0200 [PATCH v2 23/29] staging/lustre/llite: ll_revalidate_dentry update Oleg Drokin <green@linuxhacker.ru> - 2016-06-20 23:10 +0200 [PATCH v2 24/29] staging/lustre/llite: IOC_MDC_GETFILEINFO returns the wrong ino Oleg Drokin <green@linuxhacker.ru> - 2016-06-20 23:20 +0200 [PATCH v2 05/29] staging/lustre/osc: osc_lock_weight endless loop fix Oleg Drokin <green@linuxhacker.ru> - 2016-06-20 23:20 +0200 [PATCH v2 18/29] staging/lustre/ldlm: const qualify struct lustre_handle * params Oleg Drokin <green@linuxhacker.ru> - 2016-06-20 23:20 +0200 [PATCH v2 17/29] staging/lustre/llite: change it_data to it_request Oleg Drokin <green@linuxhacker.ru> - 2016-06-20 23:20 +0200 [PATCH v2 27/29] staging/lustre/osc: glimpse lock should match only with granted locks Oleg Drokin <green@linuxhacker.ru> - 2016-06-20 23:20 +0200 [PATCH v2 08/29] staging/lustre/ptlrpc: missing wakeup for ptlrpc_check_set Oleg Drokin <green@linuxhacker.ru> - 2016-06-20 23:20 +0200 [PATCH v2 22/29] staging/lustre/llite: Restore proper opencache operations Oleg Drokin <green@linuxhacker.ru> - 2016-06-20 23:20 +0200 [PATCH v2 04/29] staging/lustre/llite: lock i_lock before __d_drop() Oleg Drokin <green@linuxhacker.ru> - 2016-06-20 23:20 +0200 [PATCH v2 01/29] staging/lustre/llite: allocate and free client cache asynchronously Oleg Drokin <green@linuxhacker.ru> - 2016-06-20 23:20 +0200 [PATCH v2 28/29] staging/lustre/libcfs: Do not call kthread_run in wrong state Oleg Drokin <green@linuxhacker.ru> - 2016-06-21 00:10 +0200 [PATCH v2 06/29] staging/lustre/osc: Fix reverted condition in osc_lock_weight Oleg Drokin <green@linuxhacker.ru> - 2016-06-21 00:10 +0200 [PATCH v2 07/29] staging/lustre/ptlrpc: reorganize ptlrpc_request Oleg Drokin <green@linuxhacker.ru> - 2016-06-21 00:10 +0200
csiph-web