Messages in this thread | | | Date | Tue, 17 Mar 2015 21:06:35 -0400 | From | Steven Rostedt <> | Subject | Re: [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
| |