Re: [PATCH v2 2/4] KVM: introduce "xinterface" API for external interactionwith guests

From: Avi Kivity
Date: Thu Oct 08 2009 - 10:47:24 EST


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/