lkml.org 
[lkml]   [2015]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] sys_membarrier(): system/process-wide memory barrier (x86) (v12)
On Tue, 17 Mar 2015 12:46:41 +0000 (UTC)
Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote:


> > Would that help?
> >
> > this_cpu_write(saved_next, next);
> > rq = context_switch(rq, prev, next);
> > rq->curr = this_cpu_read(saved_next);
>
> Assuming there is a full memory barrier (e.g. load_cr3) within
> context_switch, it would help for ordering memory accesses that
> are performed prior to the preemption, but not for memory accesses
> to be performed immediately after return to userspace from preemption.

Hmm, I was thinking that there was a spin_unlock(rq->lock) after that,
but it appears that context_switch() does the unlock. If there was an
spin_unlock() after this code, then it could work. There's always
setting the rq->curr in the context_switch() call itself.

-- Steve


\
 
 \ /
  Last update: 2015-03-18 02:21    [W:0.136 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site