lkml.org 
[lkml]   [2017]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH tip/sched/core v2] sched/rt: Simplify the IPI rt balancing logic
On Thu, 4 May 2017 16:41:28 +0200
Peter Zijlstra <peterz@infradead.org> wrote:

> On Mon, Apr 24, 2017 at 11:47:32AM -0400, Steven Rostedt wrote:
> > + /* Keep the loop going if the IPI is currently active */
> > + atomic_inc_return(&rq->rd->rto_loop_next);
>
> What's the return for?

-ENOCONTEXT (too much cut from email)

/me goes and finds his email that he sent.

/* Keep the loop going if the IPI is currently active */
atomic_inc_return(&rq->rd->rto_loop_next);

/* Only one CPU can initiate a loop at a time */
if (!rto_start_trylock(&rq->rd->rto_loop_start))
return;

Ah, it's not needed. I think I had that to supply a full memory
barrier for a previous version, but now that rto_start_trylock() is:

static inline bool rto_start_trylock(atomic_t *v)
{
return !atomic_cmpxchg(v, 0, 1);
}

Which supplies its own memory barrier, it can now be a simple

atomic_inc().

Thanks, will update.

-- Steve

\
 
 \ /
  Last update: 2017-05-04 17:06    [W:0.152 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site