lkml.org 
[lkml]   [2019]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] async: Let kfree() out of the critical area of the lock
From
Date


On 2019/9/25 21:38, gregkh@linuxfoundation.org wrote:
> On Wed, Sep 25, 2019 at 08:52:26PM +0800, Yunfeng Ye wrote:
>> It's not necessary to put kfree() in the critical area of the lock, so
>> let it out.
>>
>> Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
>> ---
>> kernel/async.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/kernel/async.c b/kernel/async.c
>> index 4f9c1d6..1de270d 100644
>> --- a/kernel/async.c
>> +++ b/kernel/async.c
>> @@ -135,12 +135,12 @@ static void async_run_entry_fn(struct work_struct *work)
>> list_del_init(&entry->domain_list);
>> list_del_init(&entry->global_list);
>>
>> - /* 3) free the entry */
>> - kfree(entry);
>> atomic_dec(&entry_count);
>> -
>> spin_unlock_irqrestore(&async_lock, flags);
>>
>> + /* 3) free the entry */
>> + kfree(entry);
>> +
>> /* 4) wake up any waiters */
>> wake_up(&async_done);
>> }
>> --
>> 2.7.4
>>
>
> Does this result any any measurable performance changes?
>
No performance has been Measured at present, I just want the critical area
to be as short as possible. I think it's good to put it outside.

thanks

> thanks,
>
> greg k-h
>
> .
>

\
 
 \ /
  Last update: 2019-09-25 15:46    [W:0.095 / U:5.820 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site