From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933131AbcKHKbf (ORCPT ); Tue, 8 Nov 2016 05:31:35 -0500 Received: from mx2.suse.de ([195.135.220.15]:59573 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932301AbcKHKbc (ORCPT ); Tue, 8 Nov 2016 05:31:32 -0500 Date: Tue, 8 Nov 2016 11:31:19 +0100 From: Jan Kara To: Johannes Weiner Cc: Andrew Morton , Linus Torvalds , Jan Kara , "Kirill A. Shutemov" , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH 6/6] mm: workingset: restore refault tracking for single-page files Message-ID: <20161108103119.GM32353@quack2.suse.cz> References: <20161107190741.3619-1-hannes@cmpxchg.org> <20161107190741.3619-7-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161107190741.3619-7-hannes@cmpxchg.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 The patch looks good to me. You can add: Reviewed-by: Jan Kara 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 SUSE Labs, CR