extern unsigned int ldlm_timeout; /* seconds */
extern unsigned int obd_timeout_set;
extern unsigned int ldlm_timeout_set;
+extern unsigned int bulk_timeout;
extern unsigned int at_min;
extern unsigned int at_max;
extern unsigned int at_history;
{
struct ptlrpc_request *req = desc->bd_req;
time_t start = cfs_time_current_sec();
+ time_t deadline;
int rc = 0;
ENTRY;
*lwi = LWI_INTR(NULL, NULL);
rc = l_wait_event(exp->exp_obd->obd_evict_inprogress_waitq,
!atomic_read(&exp->exp_obd->
- obd_evict_inprogress),
+ obd_evict_inprogress),
lwi);
}
RETURN(0);
}
+ /* limit actual bulk transfer to bulk_timeout seconds */
+ deadline = start + bulk_timeout;
+ if (deadline > req->rq_deadline)
+ deadline = req->rq_deadline;
+
do {
- long timeoutl = req->rq_deadline - cfs_time_current_sec();
+ long timeoutl = deadline - cfs_time_current_sec();
cfs_duration_t timeout = timeoutl <= 0 ?
CFS_TICK : cfs_time_seconds(timeoutl);
lustre_msg_get_conn_cnt(req->rq_reqmsg),
lwi);
LASSERT(rc == 0 || rc == -ETIMEDOUT);
- /* Wait again if we changed deadline. */
+ /* Wait again if we changed rq_deadline. */
+ deadline = start + bulk_timeout;
+ if (deadline > req->rq_deadline)
+ deadline = req->rq_deadline;
} while ((rc == -ETIMEDOUT) &&
- (req->rq_deadline > cfs_time_current_sec()));
+ (deadline > cfs_time_current_sec()));
if (rc == -ETIMEDOUT) {
DEBUG_REQ(D_ERROR, req, "timeout on bulk %s after %ld%+lds",
- bulk2type(desc), req->rq_deadline - start,
- cfs_time_current_sec() - req->rq_deadline);
+ bulk2type(desc), deadline - start,
+ cfs_time_current_sec() - deadline);
ptlrpc_abort_bulk(desc);
} else if (exp->exp_failed) {
DEBUG_REQ(D_ERROR, req, "Eviction on bulk %s",
EXPORT_SYMBOL(obd_timeout_set);
unsigned int ldlm_timeout_set;
EXPORT_SYMBOL(ldlm_timeout_set);
+/* bulk transfer timeout, give up after 100s by default */
+unsigned int bulk_timeout = 100; /* seconds */
+EXPORT_SYMBOL(bulk_timeout);
/* Adaptive timeout defs here instead of ptlrpc module for /proc/sys/ access */
unsigned int at_min = 0;
EXPORT_SYMBOL(at_min);
}
#endif
+int LL_PROC_PROTO(proc_bulk_timeout)
+{
+ return proc_dointvec(table, write, buffer, lenp, ppos);
+}
int LL_PROC_PROTO(proc_at_min)
{
return proc_dointvec(table, write, buffer, lenp, ppos);
},
{
INIT_CTL_NAME
+ .procname = "bulk_timeout",
+ .data = &bulk_timeout,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = &proc_bulk_timeout
+ },
+ {
+ INIT_CTL_NAME
.procname = "at_min",
.data = &at_min,
.maxlen = sizeof(int),