Re: [PATCH v2] mm/slub: mark racy accesses on slab->slabs

Vlastimil Babka
2024-03-25T08:51:10Z

On 3/25/24 9:49 AM, Chengming Zhou wrote:
> On 2024/3/25 16:48, Vlastimil Babka wrote:
>> On 3/21/24 4:48 AM, linke li wrote:
>>> The reads of slab->slabs are racy because it may be changed by
>>> put_cpu_partial concurrently. In slabs_cpu_partial_show() and
>>> show_slab_objects(), slab->slabs is only used for showing information.
>>>
>>> Data-racy reads from shared variables that are used only for diagnostic
>>> purposes should typically use data_race(), since it is normally not a
>>> problem if the values are off by a little.
>>>
>>> This patch is aimed at reducing the number of benign races reported by
>>> KCSAN in order to focus future debugging effort on harmful races.
>>>
>>> Signed-off-by: linke li <lilinke99@qq.com>
>>> Reviewed-by: Chengming Zhou <chengming.zhou@linux.dev>
>>
>> Chengming provided feedback to v1 but not offered a Reviewed-by: AFAICS? Or
>> maybe will offer it now? :)
>
> Ah, right.
>
> Reviewed-by: Chengming Zhou <chengming.zhou@linux.dev>

Thanks, added to slab/for-6.10/cleanup