|
@@ -538,12 +538,11 @@ static void disarm_sock_keys(struct mem_cgroup *memcg)
|
|
|
* memcgs, and none but the 200th is kmem-limited, we'd have to have a
|
|
|
* 200 entry array for that.
|
|
|
*
|
|
|
- * The current size of the caches array is stored in
|
|
|
- * memcg_limited_groups_array_size. It will double each time we have to
|
|
|
- * increase it.
|
|
|
+ * The current size of the caches array is stored in memcg_nr_cache_ids. It
|
|
|
+ * will double each time we have to increase it.
|
|
|
*/
|
|
|
-static DEFINE_IDA(kmem_limited_groups);
|
|
|
-int memcg_limited_groups_array_size;
|
|
|
+static DEFINE_IDA(memcg_cache_ida);
|
|
|
+int memcg_nr_cache_ids;
|
|
|
|
|
|
/*
|
|
|
* MIN_SIZE is different than 1, because we would like to avoid going through
|
|
@@ -2538,12 +2537,12 @@ static int memcg_alloc_cache_id(void)
|
|
|
int id, size;
|
|
|
int err;
|
|
|
|
|
|
- id = ida_simple_get(&kmem_limited_groups,
|
|
|
+ id = ida_simple_get(&memcg_cache_ida,
|
|
|
0, MEMCG_CACHES_MAX_SIZE, GFP_KERNEL);
|
|
|
if (id < 0)
|
|
|
return id;
|
|
|
|
|
|
- if (id < memcg_limited_groups_array_size)
|
|
|
+ if (id < memcg_nr_cache_ids)
|
|
|
return id;
|
|
|
|
|
|
/*
|
|
@@ -2559,7 +2558,7 @@ static int memcg_alloc_cache_id(void)
|
|
|
|
|
|
err = memcg_update_all_caches(size);
|
|
|
if (err) {
|
|
|
- ida_simple_remove(&kmem_limited_groups, id);
|
|
|
+ ida_simple_remove(&memcg_cache_ida, id);
|
|
|
return err;
|
|
|
}
|
|
|
return id;
|
|
@@ -2567,7 +2566,7 @@ static int memcg_alloc_cache_id(void)
|
|
|
|
|
|
static void memcg_free_cache_id(int id)
|
|
|
{
|
|
|
- ida_simple_remove(&kmem_limited_groups, id);
|
|
|
+ ida_simple_remove(&memcg_cache_ida, id);
|
|
|
}
|
|
|
|
|
|
/*
|
|
@@ -2577,7 +2576,7 @@ static void memcg_free_cache_id(int id)
|
|
|
*/
|
|
|
void memcg_update_array_size(int num)
|
|
|
{
|
|
|
- memcg_limited_groups_array_size = num;
|
|
|
+ memcg_nr_cache_ids = num;
|
|
|
}
|
|
|
|
|
|
struct memcg_kmem_cache_create_work {
|