summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
451a263)
Passing '0' as the condition to l_wait_event() means that
it just waits for the given timeout.
This can be done more simply with ssleep(seconds) or in
one case, a schedule_timeout_killable() loop.
In most of these case, l_wait_event() in configured to ignore signals,
so ssleep() - which also ignores signals - is appropriate.
In one case (lfsck_lib.c) l_wait_event() is configured to respond
to fatal signals, and as there is no ssleep_killable, we
need to opencode one.
ssleep() and schedule_timeout_killable() *will* add to the load
average, while l_wait_event() does not, so if these sleeps happen a
lot, it will add to the load average. I don't think that will be a
problem for these sleeps.
So remove these l_wait_event() calls and associated variables,
and do it the simpler ways.
Signed-off-by: Mr NeilBrown <neilb@suse.com>
Change-Id: I5a77e631c68f6dfb45fdd7ea01d60b13268240cc
Reviewed-on: https://review.whamcloud.com/35966
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: Petros Koutoupis <pkoutoupis@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
#include <linux/err.h>
#include <linux/module.h>
#include <linux/err.h>
#include <linux/module.h>
+#include <linux/delay.h>
#include <obd.h>
#include <obd_class.h>
#include <obd_support.h>
#include <obd.h>
#include <obd_class.h>
#include <obd_support.h>
* (MDT0)yet */
rc = seq_client_rpc(seq, &seq->lcs_space,
SEQ_ALLOC_META, "meta");
* (MDT0)yet */
rc = seq_client_rpc(seq, &seq->lcs_space,
SEQ_ALLOC_META, "meta");
- if (rc == -EINPROGRESS || rc == -EAGAIN) {
- wait_queue_head_t waitq;
- struct l_wait_info lwi;
-
+ if (rc == -EINPROGRESS || rc == -EAGAIN)
/* MDT0 is not ready, let's wait for 2
* seconds and retry. */
/* MDT0 is not ready, let's wait for 2
* seconds and retry. */
- init_waitqueue_head(&waitq);
- lwi = LWI_TIMEOUT(cfs_time_seconds(2), NULL,
- NULL);
- l_wait_event(waitq, 0, &lwi);
- }
} while (rc == -EINPROGRESS || rc == -EAGAIN);
}
} while (rc == -EINPROGRESS || rc == -EAGAIN);
}
#include <linux/kthread.h>
#include <linux/sched.h>
#include <linux/list.h>
#include <linux/kthread.h>
#include <linux/sched.h>
#include <linux/list.h>
+#include <linux/delay.h>
#include <lu_object.h>
#include <dt_object.h>
#include <md_object.h>
#include <lu_object.h>
#include <dt_object.h>
#include <md_object.h>
que->lu_mdts_count[i][LS_SCANNING_PHASE2] != 0 ||
que->lu_osts_count[i][LS_SCANNING_PHASE1] != 0 ||
que->lu_osts_count[i][LS_SCANNING_PHASE2] != 0) {
que->lu_mdts_count[i][LS_SCANNING_PHASE2] != 0 ||
que->lu_osts_count[i][LS_SCANNING_PHASE1] != 0 ||
que->lu_osts_count[i][LS_SCANNING_PHASE2] != 0) {
- struct l_wait_info lwi;
-
/* If it is required to wait, then sleep
/* If it is required to wait, then sleep
- * 3 seconds and try to query again. */
- lwi = LWI_TIMEOUT_INTR(cfs_time_seconds(3),
- NULL,
- LWI_ON_SIGNAL_NOOP,
- NULL);
- rc = l_wait_event(lfsck->li_thread.t_ctl_waitq,
- 0, &lwi);
- if (rc == -ETIMEDOUT)
+ * 3 seconds and try to query again.
+ */
+ unsigned long timeout =
+ msecs_to_jiffies(3000) + 1;
+ while (timeout &&
+ !fatal_signal_pending(current))
+ timeout = schedule_timeout_killable(
+ timeout);
+ if (timeout == 0)
#include <linux/pagemap.h>
#include <linux/user_namespace.h>
#include <linux/utsname.h>
#include <linux/pagemap.h>
#include <linux/user_namespace.h>
#include <linux/utsname.h>
+#include <linux/delay.h>
#ifdef HAVE_UIDGID_HEADER
# include <linux/uidgid.h>
#endif
#ifdef HAVE_UIDGID_HEADER
# include <linux/uidgid.h>
#endif
struct ptlrpc_request *req;
struct ptlrpc_bulk_desc *desc;
int i;
struct ptlrpc_request *req;
struct ptlrpc_bulk_desc *desc;
int i;
- wait_queue_head_t waitq;
- struct l_wait_info lwi;
int rc;
ENTRY;
*request = NULL;
int rc;
ENTRY;
*request = NULL;
- init_waitqueue_head(&waitq);
restart_bulk:
req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_MDS_READPAGE);
restart_bulk:
req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_MDS_READPAGE);
exp->exp_obd->obd_name, -EIO);
RETURN(-EIO);
}
exp->exp_obd->obd_name, -EIO);
RETURN(-EIO);
}
- lwi = LWI_TIMEOUT_INTR(cfs_time_seconds(resends), NULL, NULL,
- NULL);
- l_wait_event(waitq, 0, &lwi);
#include <libcfs/libcfs.h>
#include <linux/kernel.h>
#include <libcfs/libcfs.h>
#include <linux/kernel.h>
+#include <linux/delay.h>
#include <obd_class.h>
#include <lustre_net.h>
#include <lustre_sec.h>
#include <obd_class.h>
#include <lustre_net.h>
#include <lustre_sec.h>
void ptlrpc_ni_fini(void)
{
void ptlrpc_ni_fini(void)
{
- wait_queue_head_t waitq;
- struct l_wait_info lwi;
CWARN("Event queue still busy\n");
/* Wait for a bit */
CWARN("Event queue still busy\n");
/* Wait for a bit */
- init_waitqueue_head(&waitq);
- lwi = LWI_TIMEOUT(cfs_time_seconds(2), NULL, NULL);
- l_wait_event(waitq, 0, &lwi);
#define DEBUG_SUBSYSTEM S_CLASS
#include <linux/user_namespace.h>
#define DEBUG_SUBSYSTEM S_CLASS
#include <linux/user_namespace.h>
+#include <linux/delay.h>
#ifdef HAVE_UIDGID_HEADER
# include <linux/uidgid.h>
#endif
#ifdef HAVE_UIDGID_HEADER
# include <linux/uidgid.h>
#endif
* to reorder. */
if (unlikely(CFS_FAIL_PRECHECK(OBD_FAIL_PTLRPC_CLIENT_BULK_CB2)) &&
desc) {
* to reorder. */
if (unlikely(CFS_FAIL_PRECHECK(OBD_FAIL_PTLRPC_CLIENT_BULK_CB2)) &&
desc) {
- wait_queue_head_t waitq;
- struct l_wait_info lwi1;
-
CDEBUG(D_INFO, "reorder BULK\n");
CDEBUG(D_INFO, "reorder BULK\n");
- init_waitqueue_head(&waitq);
- lwi1 = LWI_TIMEOUT_INTR(cfs_time_seconds(3), NULL, NULL, NULL);
- l_wait_event(waitq, 0, &lwi1);
target_bulk_io(exp, desc);
ptlrpc_free_bulk(desc);
}
target_bulk_io(exp, desc);
ptlrpc_free_bulk(desc);
}