On Mon, Apr 06, 2020 at 11:48:54PM +0800, Yafang Shao wrote: > @@ -2717,8 +2717,12 @@ static int memcg_alloc_cache_id(void) > > id = ida_simple_get(&memcg_cache_ida, > 0, MEMCG_CACHES_MAX_SIZE, GFP_KERNEL); > - if (id < 0) > + if (id < 0) { > + if (id == -ENOSPC) > + id = -EBUSY; > + > return id; > + } This seems more complex than my original suggestion?