[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9fee780e-2c32-bb6a-08c0-cae8fdc58e9f@redhat.com>
Date: Mon, 27 Apr 2020 14:16:18 -0400
From: Waiman Long <longman@...hat.com>
To: Qian Cai <cai@....pw>
Cc: Christoph Lameter <cl@...ux.com>,
Pekka Enberg <penberg@...nel.org>,
David Rientjes <rientjes@...gle.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux-MM <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>,
Juri Lelli <juri.lelli@...hat.com>
Subject: Re: [PATCH 2/2] mm/slub: Fix slab_mutex circular locking problem in
slab_attr_store()
On 4/24/20 12:16 PM, Qian Cai wrote:
>
>> On Apr 24, 2020, at 11:12 AM, Waiman Long <longman@...hat.com> wrote:
>>
>> diff --git a/mm/slub.c b/mm/slub.c
>> index 183ccc364ccf..255981180489 100644
>> --- a/mm/slub.c
>> +++ b/mm/slub.c
>> @@ -5567,13 +5567,30 @@ static ssize_t slab_attr_store(struct kobject *kobj,
>> return -EIO;
>>
>> err = attribute->store(s, buf, len);
>> -#ifdef CONFIG_MEMCG
>> - if (slab_state >= FULL && err >= 0 && is_root_cache(s)) {
>> - struct kmem_cache *c;
>> +#ifdef CONFIG_MEMCG_KMEM
>> + if (slab_state >= FULL && err >= 0 && is_root_cache(s) &&
>> + !list_empty(&s->memcg_params.children)) {
>> + struct kmem_cache *c, **pcaches;
>> + int idx, max, cnt = 0;
>> + size_t size = s->max_attr_size;
>> + struct memcg_cache_array *arr;
>> +
>> + /*
>> + * Make atomic update to s->max_attr_size.
>> + */
>> + do {
>> + if (len <= size)
>> + break;
>> + } while (!try_cmpxchg(&s->max_attr_size, &size, len));
>>
> try_cmpxchg() is only available on x86.
>
> mm/slub.c: In function ‘slab_attr_store’:
> mm/slub.c:5613:13: error: implicit declaration of function ‘try_cmpxchg’; did you mean ‘xa_cmpxchg’? [-Werror=implicit-function-declaration]
> } while (!try_cmpxchg(&s->max_attr_size, &size, len));
> ^~~~~~~~~~~
> xa_cmpxchg
>
Oh, sorry about that. Will fix it and send out v2.
Cheers,
Longman
Powered by blists - more mailing lists