|
@@ -3748,7 +3748,11 @@ __kmem_cache_alias(const char *name, size_t size, size_t align,
|
|
|
|
|
|
s = find_mergeable(size, align, flags, name, ctor);
|
|
s = find_mergeable(size, align, flags, name, ctor);
|
|
if (s) {
|
|
if (s) {
|
|
|
|
+ int i;
|
|
|
|
+ struct kmem_cache *c;
|
|
|
|
+
|
|
s->refcount++;
|
|
s->refcount++;
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Adjust the object sizes so that we clear
|
|
* Adjust the object sizes so that we clear
|
|
* the complete object on kzalloc.
|
|
* the complete object on kzalloc.
|
|
@@ -3756,6 +3760,15 @@ __kmem_cache_alias(const char *name, size_t size, size_t align,
|
|
s->object_size = max(s->object_size, (int)size);
|
|
s->object_size = max(s->object_size, (int)size);
|
|
s->inuse = max_t(int, s->inuse, ALIGN(size, sizeof(void *)));
|
|
s->inuse = max_t(int, s->inuse, ALIGN(size, sizeof(void *)));
|
|
|
|
|
|
|
|
+ for_each_memcg_cache_index(i) {
|
|
|
|
+ c = cache_from_memcg_idx(s, i);
|
|
|
|
+ if (!c)
|
|
|
|
+ continue;
|
|
|
|
+ c->object_size = s->object_size;
|
|
|
|
+ c->inuse = max_t(int, c->inuse,
|
|
|
|
+ ALIGN(size, sizeof(void *)));
|
|
|
|
+ }
|
|
|
|
+
|
|
if (sysfs_slab_alias(s, name)) {
|
|
if (sysfs_slab_alias(s, name)) {
|
|
s->refcount--;
|
|
s->refcount--;
|
|
s = NULL;
|
|
s = NULL;
|