Messages in this thread | | | Date | Thu, 08 Oct 2009 16:45:51 +0200 | From | Avi Kivity <> | Subject | Re: [PATCH v2 2/4] KVM: introduce "xinterface" API for external interaction with guests |
| |
On 10/07/2009 02:48 PM, Gregory Haskins wrote: > >> If f() can cause another agent to write to p (by freeing >> it to a global list, for example), then it is its responsibility to >> issue the smp_rmb(), otherwise no calculation that took place before f() >> and accessed p is safe. >> >> > IOW: David is right. You need a cpu-barrier one way or the other. We > can either allow ->release() to imply one (and probably document it that > way, like we did for slow-work), or we can be explicit.
No, ->release() must do it or it becomes impossible to program. And in fact it will, to place the freed structure on a global list it must take a lock which implies an smp_rmb().
> I chose to be > explicit since it is kind of self-documenting, and there is no need to > be worried about performance since the release is slow-path. >
It's so self-documenting I had no idea what it was there for.
-- error compiling committee.c: too many arguments to function
| |