On 20/11/2020 07:14, Hannes Reinecke wrote:
The usage of atomic_add_unless() is a bit unusual; one might consider using atomic_test_and_set(). Also it seems to be a bit of a waste using an atomic counter here, seeing that the only values ever used are 0 and 1. But this is largely cosmetic, so:struct rdpq_alloc_detail rdpq_tracker[RDPQ_MAX_CHUNK_COUNT];
atomic_add_unless() is generally implemented with a cmpxchg(), which can be inefficient also.
John