Re: [PATCH 08/10] mm: Turn deactivate_file_page() into deactivate_file_folio()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2022/2/16 4:33, Matthew Wilcox wrote:
> On Tue, Feb 15, 2022 at 04:26:22PM +0800, Miaohe Lin wrote:
>>> +	folio_get(folio);
>>
>> Should we comment the assumption that caller already hold the refcnt?
> 
> Added to the kernel-doc:
> + * Context: Caller holds a reference on the page.
> 

I see. Thanks.

>> Anyway, this patch looks good to me. Thanks.
>>
>> Reviewed-by: Miaohe Lin <linmiaohe@xxxxxxxxxx>
>>
>>> +	local_lock(&lru_pvecs.lock);
>>> +	pvec = this_cpu_ptr(&lru_pvecs.lru_deactivate_file);
>>>  
>>> -		if (pagevec_add_and_need_flush(pvec, page))
>>> -			pagevec_lru_move_fn(pvec, lru_deactivate_file_fn);
>>> -		local_unlock(&lru_pvecs.lock);
>>> -	}
>>> +	if (pagevec_add_and_need_flush(pvec, &folio->page))
>>> +		pagevec_lru_move_fn(pvec, lru_deactivate_file_fn);
>>> +	local_unlock(&lru_pvecs.lock);
>>>  }
>>>  
>>>  /*
>>> diff --git a/mm/truncate.c b/mm/truncate.c
>>> index 567557c36d45..14486e75ec28 100644
>>> --- a/mm/truncate.c
>>> +++ b/mm/truncate.c
>>> @@ -525,7 +525,7 @@ static unsigned long __invalidate_mapping_pages(struct address_space *mapping,
>>>  			 * of interest and try to speed up its reclaim.
>>>  			 */
>>>  			if (!ret) {
>>> -				deactivate_file_page(&folio->page);
>>> +				deactivate_file_folio(folio);
>>>  				/* It is likely on the pagevec of a remote CPU */
>>>  				if (nr_pagevec)
>>>  					(*nr_pagevec)++;
>>>
>>
>>
> .
> 





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux