Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1499149

Re: [PATCHv3 13/41] truncate: make sure invalidate_mapping_pages() can discard huge pages

From Jan Kara <jack@suse.cz>
Newsgroups linux.kernel
Subject Re: [PATCHv3 13/41] truncate: make sure invalidate_mapping_pages() can discard huge pages
Date 2016-10-11 21:00 +0200
Message-ID <srarn-1SH-1@gated-at.bofh.it> (permalink)
References <shDuF-6vN-5@gated-at.bofh.it> <shDuG-6vN-39@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu 15-09-16 14:54:55, Kirill A. Shutemov wrote:
> invalidate_inode_page() has expectation about page_count() of the page
> -- if it's not 2 (one to caller, one to radix-tree), it will not be
> dropped. That condition almost never met for THPs -- tail pages are
> pinned to the pagevec.
> 
> Let's drop them, before calling invalidate_inode_page().
> 
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> ---
>  mm/truncate.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/mm/truncate.c b/mm/truncate.c
> index a01cce450a26..ce904e4b1708 100644
> --- a/mm/truncate.c
> +++ b/mm/truncate.c
> @@ -504,10 +504,21 @@ unsigned long invalidate_mapping_pages(struct address_space *mapping,
>  				/* 'end' is in the middle of THP */
>  				if (index ==  round_down(end, HPAGE_PMD_NR))
>  					continue;
> +				/*
> +				 * invalidate_inode_page() expects
> +				 * page_count(page) == 2 to drop page from page
> +				 * cache -- drop tail pages references.
> +				 */
> +				get_page(page);
> +				pagevec_release(&pvec);

I'm not quite sure why this is needed. When you have multiorder entry in
the radix tree for your huge page, then you should not get more entries in
the pagevec for your huge page. What do I miss?

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCHv3 13/41] truncate: make sure invalidate_mapping_pages()  can discard huge pages Jan Kara <jack@suse.cz> - 2016-10-11 21:00 +0200
  Re: [PATCHv3 13/41] truncate: make sure invalidate_mapping_pages()  can discard huge pages "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-10-12 00:10 +0200
    Re: [PATCHv3 13/41] truncate: make sure invalidate_mapping_pages()  can discard huge pages Jan Kara <jack@suse.cz> - 2016-10-12 08:50 +0200

csiph-web