On Tue, Oct 20, 2020 at 09:58:34PM +0200, David Hildenbrand wrote: > I remember there were some !BQL users (but I might be confusing it with > postcopy code that once used to inhibit the balloon without BQL). Will > double-check. Simplifying it is certainly a good idea. > > (we want to be able to check from virtio-balloon code repeatedly without > taking a mutex over and over again :) )
Right. Again I've no strong opinion so feel free to keep the codes as wish. However if we'd go the other way (either BQL or another mutex) IMHO we can simply read that flag directly without taking mutex. IMHO here the mutex can be used to protect write concurrency and should be enough. Considering that this flag should rarely change and it should never flip (e.g., positive would never go negative, and vise versa), then READ_ONCE() whould be safe enough on read side (e.g., balloon). Thanks, -- Peter Xu
