@@ -1558,7 +1558,7 @@ struct ptlrpc_service_part {
struct list_head scp_rqbd_posted;
/** incoming reqs */
struct list_head scp_req_incoming;
- /** timeout before re-posting reqs, in tick */
+ /** timeout before re-posting reqs, in jiffies */
long scp_rqbd_timeout;
/**
* all threads sleep on this. This wait-queue is signalled when new
@@ -1611,7 +1611,7 @@ struct ptlrpc_service_part {
/** early reply timer */
struct timer_list scp_at_timer;
/** debug */
- unsigned long scp_at_checktime;
+ ktime_t scp_at_checktime;
/** check early replies */
unsigned scp_at_check;
/** @} */
@@ -887,7 +887,7 @@ static void ldlm_pools_recalc(struct work_struct *ws)
struct ldlm_namespace *ns;
struct ldlm_namespace *ns_old = NULL;
/* seconds of sleep if no active namespaces */
- int time = LDLM_POOL_CLI_DEF_RECALC_PERIOD;
+ time64_t time = LDLM_POOL_CLI_DEF_RECALC_PERIOD;
int nr;
/*
@@ -953,7 +953,7 @@ static void ldlm_pools_recalc(struct work_struct *ws)
* After setup is done - recalc the pool.
*/
if (!skip) {
- int ttime = ldlm_pool_recalc(&ns->ns_pool);
+ time64_t ttime = ldlm_pool_recalc(&ns->ns_pool);
if (ttime < time)
time = ttime;
@@ -242,7 +242,7 @@ void ptlrpc_deactivate_import(struct obd_import *imp)
return dl - now;
}
-static unsigned int ptlrpc_inflight_timeout(struct obd_import *imp)
+static time64_t ptlrpc_inflight_timeout(struct obd_import *imp)
{
time64_t now = ktime_get_real_seconds();
struct ptlrpc_request *req, *n;
@@ -342,7 +342,7 @@ static void ptlrpc_at_timer(struct timer_list *t)
svcpt = from_timer(svcpt, t, scp_at_timer);
svcpt->scp_at_check = 1;
- svcpt->scp_at_checktime = jiffies;
+ svcpt->scp_at_checktime = ktime_get();
wake_up(&svcpt->scp_waitq);
}
@@ -933,7 +933,7 @@ static int ptlrpc_check_req(struct ptlrpc_request *req)
static void ptlrpc_at_set_timer(struct ptlrpc_service_part *svcpt)
{
struct ptlrpc_at_array *array = &svcpt->scp_at_array;
- s32 next;
+ time64_t next;
if (array->paa_count == 0) {
del_timer(&svcpt->scp_at_timer);
@@ -941,13 +941,14 @@ static void ptlrpc_at_set_timer(struct ptlrpc_service_part *svcpt)
}
/* Set timer for closest deadline */
- next = (s32)(array->paa_deadline - ktime_get_real_seconds() -
- at_early_margin);
+ next = array->paa_deadline - ktime_get_real_seconds() -
+ at_early_margin;
if (next <= 0) {
ptlrpc_at_timer(&svcpt->scp_at_timer);
} else {
- mod_timer(&svcpt->scp_at_timer, jiffies + next * HZ);
- CDEBUG(D_INFO, "armed %s at %+ds\n",
+ mod_timer(&svcpt->scp_at_timer,
+ jiffies + nsecs_to_jiffies(next * NSEC_PER_SEC));
+ CDEBUG(D_INFO, "armed %s at %+llds\n",
svcpt->scp_service->srv_name, next);
}
}
@@ -1181,7 +1182,7 @@ static void ptlrpc_at_check_timed(struct ptlrpc_service_part *svcpt)
u32 index, count;
time64_t deadline;
time64_t now = ktime_get_real_seconds();
- long delay;
+ s64 delay;
int first, counter = 0;
spin_lock(&svcpt->scp_at_lock);
@@ -1189,7 +1190,7 @@ static void ptlrpc_at_check_timed(struct ptlrpc_service_part *svcpt)
spin_unlock(&svcpt->scp_at_lock);
return;
}
- delay = jiffies - svcpt->scp_at_checktime;
+ delay = ktime_ms_delta(ktime_get(), svcpt->scp_at_checktime);
svcpt->scp_at_check = 0;
if (array->paa_count == 0) {
@@ -1254,7 +1255,7 @@ static void ptlrpc_at_check_timed(struct ptlrpc_service_part *svcpt)
*/
LCONSOLE_WARN("%s: This server is not able to keep up with request traffic (cpu-bound).\n",
svcpt->scp_service->srv_name);
- CWARN("earlyQ=%d reqQ=%d recA=%d, svcEst=%d, delay=%ld(jiff)\n",
+ CWARN("earlyQ=%d reqQ=%d recA=%d, svcEst=%d, delay=%lld\n",
counter, svcpt->scp_nreqs_incoming,
svcpt->scp_nreqs_active,
at_get(&svcpt->scp_at_estimate), delay);
@@ -129,7 +129,7 @@ static int param_get_delay(char *buffer, const struct kernel_param *kp)
{
unsigned int d = *(unsigned int *)kp->arg;
- return sprintf(buffer, "%u", (unsigned int)(d * 100) / HZ);
+ return sprintf(buffer, "%lu", jiffies_to_msecs(d * 10) / MSEC_PER_SEC);
}
unsigned int libcfs_console_max_delay;