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


Groups > linux.kernel > #1507647

Re: [Stable 4.4 - NEEDS REVIEW - 2/3] mm: filemap: don't plant shadow entries without radix tree node

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [Stable 4.4 - NEEDS REVIEW - 2/3] mm: filemap: don't plant shadow entries without radix tree node
Date Mon, 24 Oct 2016 21:20:02 +0200
Message-ID <svSWS-3rd-29@gated-at.bofh.it> (permalink)
References <svPmh-ZI-3@gated-at.bofh.it> <svPmh-ZI-1@gated-at.bofh.it> <svSDw-34S-11@gated-at.bofh.it>
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=8fo386PtjgUmPDfsulGRwGi69rnR0Vd8j1w1fdCIFtk=; b=mjdQgn/rnF4lgqVGsiO7ajHh626uxgJpF+WqvzLFw88Cdkx1UCLFtMa6MxiqsONU+C 47HwK3tRno17LPa7hdtOrMpOFIiHEzajFWLZ5LiRjppSXiiWdgX58O0NS8Ti1oIvlhRb Ca4jEkTik8DuSNsUu+7i/vMiYD7q4TY/UofpeSr4HEHsOr2TJg5On8vihnw/hnPXSYTW 7ABBv13Vk3v3EI2YowfyKmWrJvVbV5bkxk6s+6wB2AoNsO8HEClrvpUog0s2kV98iOd+ bFTyzOb3O3xtOO6RliTXMC3J706mz5AJsrh58ZDOTA/23Q5EwVnkhOOnOpZzK+RVMsUc pzQw==
X-Gm-Message-State AA6/9Rlgb2Ocvxhx4BykNa8/tk+GhUtp0/Kw/2wJmoUZhYpY78gV62XGxDWiKQu9Esp5RA==
X-Received by 10.28.224.139 with SMTP id x133mr25187134wmg.6.1477336098542; Mon, 24 Oct 2016 12:08:18 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.6.0 (2016-04-01)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 49
Organization linux.* mail to news gateway
X-Original-Cc Stable tree <stable@vger.kernel.org>, linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>, Andrew Morton <akpm@linux-foundation.org>, Linus Torvalds <torvalds@linux-foundation.org>, Jan Kara <jack@suse.cz>
X-Original-Date Mon, 24 Oct 2016 21:08:17 +0200
X-Original-Message-ID <20161024190816.GE13148@dhcp22.suse.cz>
X-Original-References <20161024152605.11707-1-mhocko@kernel.org> <20161024152605.11707-3-mhocko@kernel.org> <20161024185600.GB28326@cmpxchg.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1507647

Show key headers only | View raw


On Mon 24-10-16 14:56:00, Johannes Weiner wrote:
> Hi Michal,
> 
> On Mon, Oct 24, 2016 at 05:26:04PM +0200, Michal Hocko wrote:
> > @@ -155,44 +155,27 @@ static void page_cache_tree_delete(struct address_space *mapping,
> >  				   struct page *page, void *shadow)
> >  {
> >  	struct radix_tree_node *node;
> > -	unsigned long index;
> > -	unsigned int offset;
> > -	unsigned int tag;
> >  	void **slot;
> >  
> >  	VM_BUG_ON(!PageLocked(page));
> >  
> >  	__radix_tree_lookup(&mapping->page_tree, page->index, &node, &slot);
> >  
> > -	if (shadow) {
> > -		mapping->nrshadows++;
> > -		/*
> > -		 * Make sure the nrshadows update is committed before
> > -		 * the nrpages update so that final truncate racing
> > -		 * with reclaim does not see both counters 0 at the
> > -		 * same time and miss a shadow entry.
> > -		 */
> > -		smp_wmb();
> > -	}
> > -	mapping->nrpages--;
> > +	radix_tree_clear_tags(&mapping->page_tree, node, slot);
> >  
> >  	if (!node) {
> > -		/* Clear direct pointer tags in root node */
> > -		mapping->page_tree.gfp_mask &= __GFP_BITS_MASK;
> > -		radix_tree_replace_slot(slot, shadow);
> > -		return;
> > -	}
> 
> There is no need to include the refactoring of the tag clearing in the
> stable backport. I already sent a simpler backport of this patch for
> 4.4 to Greg, attached here for reference:

I do not see this in 4.4 so maybe it's fallen through cracks. Yours
definitely looks easier and I will use it. I will post all 4 patches for
inclusion for stable tomorrow unless something else pops out.

Thanks for the review again!
-- 
Michal Hocko
SUSE Labs

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


Thread

[Stable 4.4 - NEEDS REVIEW - 0/3] mm: working set fixes Michal Hocko <mhocko@kernel.org> - 2016-10-24 17:30 +0200
  [Stable 4.4 - NEEDS REVIEW - 2/3] mm: filemap: don't plant shadow entries without radix tree node Michal Hocko <mhocko@kernel.org> - 2016-10-24 17:30 +0200
    Re: [Stable 4.4 - NEEDS REVIEW - 2/3] mm: filemap: don't plant  shadow entries without radix tree node Johannes Weiner <hannes@cmpxchg.org> - 2016-10-24 21:00 +0200
      Re: [Stable 4.4 - NEEDS REVIEW - 2/3] mm: filemap: don't plant  shadow entries without radix tree node Michal Hocko <mhocko@kernel.org> - 2016-10-24 21:20 +0200
  [Stable 4.4 - NEEDS REVIEW - 3/3] mm: filemap: fix mapping->nrpages double accounting in fuse Michal Hocko <mhocko@kernel.org> - 2016-10-24 17:30 +0200
    Re: [Stable 4.4 - NEEDS REVIEW - 3/3] mm: filemap: fix  mapping->nrpages double accounting in fuse Johannes Weiner <hannes@cmpxchg.org> - 2016-10-24 21:00 +0200
  [Stable 4.4 - NEEDS REVIEW - 1/3] mm: workingset: fix crash in shadow node shrinker caused by replace_page_cache_page() Michal Hocko <mhocko@kernel.org> - 2016-10-24 17:30 +0200
    Re: [Stable 4.4 - NEEDS REVIEW - 1/3] mm: workingset: fix crash in  shadow node shrinker caused by replace_page_cache_page() Michal Hocko <mhocko@kernel.org> - 2016-10-24 21:00 +0200
    Re: [Stable 4.4 - NEEDS REVIEW - 1/3] mm: workingset: fix crash in  shadow node shrinker caused by replace_page_cache_page() Johannes Weiner <hannes@cmpxchg.org> - 2016-10-24 21:00 +0200

csiph-web