[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH v2 2/2] tools/misc: Add xen-vcpus-stats tool



Hi,

Sorry for the late reply.

On 17/03/2023 11:01, Matias Ezequiel Vara Larsen wrote:
On Thu, Feb 23, 2023 at 08:31:29PM +0000, Julien Grall wrote:
+#define rmb()   asm volatile("lfence":::"memory")

This is rmb(), but rmb() isn't what you want.

You want smp_rmb(), which is

#define smp_rmb() asm volatile ("" ::: "memory")

 From the generic PoV, I find smp_rmb() a bit misleading because it is not
clear in this context whether we are referring to the SMP-ness of the
hypervisor or the tools domain.

If the latter, then technically it could be uniprocessor domain and one
could argue that for Arm it could be downgraded to just a compiler barrier.

AFAICT, this would not be the case here because we are getting data from
Xen. So we always need a "dmb ish".

So, I would suggest to name it virt_*() (to match Linux's naming).

Also, is this tool meant to be arch-agnostic? If so, then we need to
introduce the proper barrier for the other arch.

Thanks Julien for the comment. Is it `xen_rmb()` meant for that?

I believe so.


Matias

--
Julien Grall



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.