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


Groups > linux.kernel > #1516498 > unrolled thread

[PATCH 6/6] mm: workingset: restore refault tracking for single-page files

Started byJohannes Weiner <hannes@cmpxchg.org>
First post2016-11-07 20:10 +0100
Last post2016-11-08 11:40 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 6/6] mm: workingset: restore refault tracking for single-page files Johannes Weiner <hannes@cmpxchg.org> - 2016-11-07 20:10 +0100
    Re: [PATCH 6/6] mm: workingset: restore refault tracking for  single-page files Jan Kara <jack@suse.cz> - 2016-11-08 11:40 +0100

#1516498 — [PATCH 6/6] mm: workingset: restore refault tracking for single-page files

FromJohannes Weiner <hannes@cmpxchg.org>
Date2016-11-07 20:10 +0100
Subject[PATCH 6/6] mm: workingset: restore refault tracking for single-page files
Message-ID<sAXsS-7ns-17@gated-at.bofh.it>
Shadow entries in the page cache used to be accounted behind the radix
tree implementation's back in the upper bits of node->count, and the
radix tree code extending a single-entry tree with a shadow entry in
root->rnode would corrupt that counter. As a result, we could not put
shadow entries at index 0 if the tree didn't have any other entries,
and that means no refault detection for any single-page file.

Now that the shadow entries are tracked natively in the radix tree's
exceptional counter, this is no longer necessary. Extending and
shrinking the tree from and to single entries in root->rnode now does
the right thing when the entry is exceptional, remove that limitation.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
---
 mm/filemap.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/mm/filemap.c b/mm/filemap.c
index 438f0b54f8fd..55a3b136a527 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -178,19 +178,12 @@ static void page_cache_tree_delete(struct address_space *mapping,
 
 		radix_tree_clear_tags(&mapping->page_tree, node, slot);
 
-		if (!node) {
-			VM_BUG_ON_PAGE(nr != 1, page);
-			/*
-			 * We need a node to properly account shadow
-			 * entries. Don't plant any without. XXX
-			 */
-			shadow = NULL;
-		}
-
 		__radix_tree_replace(&mapping->page_tree, node, slot, shadow);
 
-		if (!node)
+		if (!node) {
+			VM_BUG_ON_PAGE(nr != 1, page);
 			break;
+		}
 
 		if (!shadow &&
 		    __radix_tree_delete_node(&mapping->page_tree, node))
-- 
2.10.1

[toc] | [next] | [standalone]


#1517065 — Re: [PATCH 6/6] mm: workingset: restore refault tracking for single-page files

FromJan Kara <jack@suse.cz>
Date2016-11-08 11:40 +0100
SubjectRe: [PATCH 6/6] mm: workingset: restore refault tracking for single-page files
Message-ID<sBbYS-8bd-31@gated-at.bofh.it>
In reply to#1516498
On Mon 07-11-16 14:07:41, Johannes Weiner wrote:
> Shadow entries in the page cache used to be accounted behind the radix
> tree implementation's back in the upper bits of node->count, and the
> radix tree code extending a single-entry tree with a shadow entry in
> root->rnode would corrupt that counter. As a result, we could not put
> shadow entries at index 0 if the tree didn't have any other entries,
> and that means no refault detection for any single-page file.
> 
> Now that the shadow entries are tracked natively in the radix tree's
> exceptional counter, this is no longer necessary. Extending and
> shrinking the tree from and to single entries in root->rnode now does
> the right thing when the entry is exceptional, remove that limitation.
> 
> Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>

The patch looks good to me. You can add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  mm/filemap.c | 13 +++----------
>  1 file changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/mm/filemap.c b/mm/filemap.c
> index 438f0b54f8fd..55a3b136a527 100644
> --- a/mm/filemap.c
> +++ b/mm/filemap.c
> @@ -178,19 +178,12 @@ static void page_cache_tree_delete(struct address_space *mapping,
>  
>  		radix_tree_clear_tags(&mapping->page_tree, node, slot);
>  
> -		if (!node) {
> -			VM_BUG_ON_PAGE(nr != 1, page);
> -			/*
> -			 * We need a node to properly account shadow
> -			 * entries. Don't plant any without. XXX
> -			 */
> -			shadow = NULL;
> -		}
> -
>  		__radix_tree_replace(&mapping->page_tree, node, slot, shadow);
>  
> -		if (!node)
> +		if (!node) {
> +			VM_BUG_ON_PAGE(nr != 1, page);
>  			break;
> +		}
>  
>  		if (!shadow &&
>  		    __radix_tree_delete_node(&mapping->page_tree, node))
> -- 
> 2.10.1
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web