lkml.org 
[lkml]   [2014]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] nohz: use delayed iowait accounting to avoid race on idle time stats
On Thu, Apr 17, 2014 at 12:05:19PM +0200, Peter Zijlstra wrote:
> +static inline void iowait_start(struct rq *rq)
> +{
> + raw_spin_lock(&rq->iowait_lock);
> + rq->nr_iowait++;
> + raw_spin_unlock(&rq->iowait_lock);
> + current->in_iowait = 1;
> +}
> +
> +static inline void iowait_stop(struct rq *rq)
> +{
> + current->in_iowait = 0;
> + raw_spin_lock(&rq->iowait_lock);
> + rq->nr_iowait--;
> + if (!rq->nr_iowait && rq != this_rq())
> + rq->last_iowait = ktime_get();
> + raw_spin_unlock(&rq->iowait_lock);
> +}

We could actually use lockref here...


\
 
 \ /
  Last update: 2014-04-17 15:01    [W:0.056 / U:0.604 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site