lkml.org 
[lkml]   [2021]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] swap: Check nrexceptional of swap cache before being freed
Date
Matthew Wilcox <willy@infradead.org> writes:

> On Wed, Jan 20, 2021 at 03:27:11PM +0800, Huang Ying wrote:
>> To catch the error in updating the swap cache shadow entries or their count.
>
> I just resent a patch that removes nrexceptional tracking.
>
> Can you use !mapping_empty() instead?

Sure. Will use that in the next version.

Best Regards,
Huang, Ying

>> void exit_swap_address_space(unsigned int type)
>> {
>> - kvfree(swapper_spaces[type]);
>> + int i;
>> + struct address_space *spaces = swapper_spaces[type];
>> +
>> + for (i = 0; i < nr_swapper_spaces[type]; i++)
>> + VM_BUG_ON(spaces[i].nrexceptional);
>> + kvfree(spaces);
>> nr_swapper_spaces[type] = 0;
>> swapper_spaces[type] = NULL;
>> }
>> --
>> 2.29.2
>>
>>

\
 
 \ /
  Last update: 2021-01-22 01:04    [W:0.075 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site