Re: page cache: Store only head pages in i_pages

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

 




On 3/22/19 11:38 PM, Matthew Wilcox wrote:
> On Fri, Mar 22, 2019 at 04:12:48PM -0400, Qian Cai wrote:
>> FYI, every thing involve swapping seems triggered a panic now since this patch.
> 
> Thanks for the report!  Does this fix it?
> 
> diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
> index 41858a3744b4..975aea9a49a5 100644
> --- a/include/linux/pagemap.h
> +++ b/include/linux/pagemap.h
> @@ -335,6 +335,8 @@ static inline struct page *grab_cache_page_nowait(struct address_space *mapping,
>  static inline struct page *find_subpage(struct page *page, pgoff_t offset)
>  {
>  	VM_BUG_ON_PAGE(PageTail(page), page);
> +	if (unlikely(PageSwapCache(page)))
> +		return page;
>  	VM_BUG_ON_PAGE(page->index > offset, page);
>  	VM_BUG_ON_PAGE(page->index + compound_nr(page) <= offset, page);
>  	return page - page->index + offset;

Yes, it works.




[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