Re: [PATCH] genalloc: Make the avail variable an atomic64_t

From: Logan Gunthorpe
Date: Wed Oct 25 2017 - 11:47:26 EST




On 25/10/17 09:32 AM, sbates@xxxxxxxxxxxx wrote:
From: Stephen Bates <sbates@xxxxxxxxxxxx>

If the amount of resources allocated to a gen_pool exceeds 2^32 then
the avail atomic overflows and this causes problems when clients try
and borrow resources from the pool.

Add the <linux/atomic.h> header to pull in atomic64 operations on
platforms that do not support them natively.

Signed-off-by: Stephen Bates <sbates@xxxxxxxxxxxx>

Reviewed-by: Logan Gunthorpe <logang@xxxxxxxxxxxx>

This looks pretty straightforward to me.

Logan