lkml.org 
[lkml]   [2021]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] mm, slub: emit the "free" trace report before freeing memory in kmem_cache_free()
From
Date


On 2021/11/2 22:39, Vlastimil Babka wrote:
> On 11/2/21 14:53, Tang Yizhou wrote:
>> On 2021/11/2 19:43, Yunfeng Ye wrote:
>>> --- a/mm/slub.c
>>> +++ b/mm/slub.c
>>> @@ -3526,8 +3526,8 @@ void kmem_cache_free(struct kmem_cache *s, void *x)
>>> s = cache_from_obj(s, x);
>>> if (!s)
>>> return;
>>> - slab_free(s, virt_to_head_page(x), x, NULL, 1, _RET_IP_);
>>> trace_kmem_cache_free(_RET_IP_, x, s->name);
>>> + slab_free(s, virt_to_head_page(x), x, NULL, 1, _RET_IP_);
>>> }
>>
>> It seems that kmem_cache_free() in mm/slab.c has the same problem.
>> We can fix it. Thanks.
>
> Doh, true. Should go best before the local_irq_save() there.
> And also kmem_cache_free() in mm/slob.c.
>
Yes, I will fix the same problem together in the v3 patch.

Thanks.


> Interestingly kfree() is already OK in all 3 implementations.
>
>>> EXPORT_SYMBOL(kmem_cache_free);
>>>
>>
>
> .
>

\
 
 \ /
  Last update: 2021-11-03 04:40    [W:0.044 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site