All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russ Anderson <rja@sgi.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org,
	torvalds@linux-foundation.org, tony.luck@intel.com,
	clameter@sgi.com
Subject: Re: [PATCH 2/3] mm: Avoid putting a bad page back on the LRU v3
Date: Fri, 09 May 2008 21:51:16 +0000	[thread overview]
Message-ID: <20080509215116.GA32718@sgi.com> (raw)
In-Reply-To: <20080509131134.dae2bd65.akpm@linux-foundation.org>

On Fri, May 09, 2008 at 01:11:34PM -0700, Andrew Morton wrote:
> On Fri, 9 May 2008 10:10:58 -0500
> Russ Anderson <rja@sgi.com> wrote:
> 
> > Index: linus/mm/swap.c
> > =================================> > --- linus.orig/mm/swap.c	2008-05-09 09:19:40.466984064 -0500
> > +++ linus/mm/swap.c	2008-05-09 09:20:11.330791803 -0500
> > @@ -195,6 +195,8 @@ void lru_cache_add(struct page *page)
> >  	struct pagevec *pvec = &get_cpu_var(lru_add_pvecs);
> >  
> >  	page_cache_get(page);
> > +	if (unlikely(PageMemError(page)))
> > +		return;		/* Don't add bad pages to the page list */
> >  	if (!pagevec_add(pvec, page))
> >  		__pagevec_lru_add(pvec);
> >  	put_cpu_var(lru_add_pvecs);
> > @@ -205,6 +207,8 @@ void lru_cache_add_active(struct page *p
> >  	struct pagevec *pvec = &get_cpu_var(lru_add_active_pvecs);
> >  
> >  	page_cache_get(page);
> > +	if (unlikely(PageMemError(page)))
> > +		return;		/* Don't add bad pages to the page list */
> >  	if (!pagevec_add(pvec, page))
> >  		__pagevec_lru_add_active(pvec);
> >  	put_cpu_var(lru_add_active_pvecs);
> 
> These PageMemError() tests are happening in some pretty darn hot paths. 
> But we've gone and added this overhead to a lot of architectures and
> configs which don't need it.
>
> Should we tighten that up?  Arrange for PageMemError() to evaluate to
> constant zero for all builds which don't actually implement "Migrate data
> off physical pages with correctable errors"?

Yes.

> Probably the way to implement that would be to add a new
> CONFIG_NEED_PAGE_MEM_ERROR and `select' that from the appropriate place in
> ia64 Kconfig.  Which is pretty nasty, but a) we're nasty that way rather
> often and b) this time it _is_ a hot-path, so some nastiness is
> justifiable.

Will do.

-- 
Russ Anderson, OS RAS/Partitioning Project Lead  
SGI - Silicon Graphics Inc          rja@sgi.com

WARNING: multiple messages have this Message-ID (diff)
From: Russ Anderson <rja@sgi.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org,
	torvalds@linux-foundation.org, tony.luck@intel.com,
	clameter@sgi.com
Subject: Re: [PATCH 2/3] mm: Avoid putting a bad page back on the LRU v3
Date: Fri, 9 May 2008 16:51:16 -0500	[thread overview]
Message-ID: <20080509215116.GA32718@sgi.com> (raw)
In-Reply-To: <20080509131134.dae2bd65.akpm@linux-foundation.org>

On Fri, May 09, 2008 at 01:11:34PM -0700, Andrew Morton wrote:
> On Fri, 9 May 2008 10:10:58 -0500
> Russ Anderson <rja@sgi.com> wrote:
> 
> > Index: linus/mm/swap.c
> > ===================================================================
> > --- linus.orig/mm/swap.c	2008-05-09 09:19:40.466984064 -0500
> > +++ linus/mm/swap.c	2008-05-09 09:20:11.330791803 -0500
> > @@ -195,6 +195,8 @@ void lru_cache_add(struct page *page)
> >  	struct pagevec *pvec = &get_cpu_var(lru_add_pvecs);
> >  
> >  	page_cache_get(page);
> > +	if (unlikely(PageMemError(page)))
> > +		return;		/* Don't add bad pages to the page list */
> >  	if (!pagevec_add(pvec, page))
> >  		__pagevec_lru_add(pvec);
> >  	put_cpu_var(lru_add_pvecs);
> > @@ -205,6 +207,8 @@ void lru_cache_add_active(struct page *p
> >  	struct pagevec *pvec = &get_cpu_var(lru_add_active_pvecs);
> >  
> >  	page_cache_get(page);
> > +	if (unlikely(PageMemError(page)))
> > +		return;		/* Don't add bad pages to the page list */
> >  	if (!pagevec_add(pvec, page))
> >  		__pagevec_lru_add_active(pvec);
> >  	put_cpu_var(lru_add_active_pvecs);
> 
> These PageMemError() tests are happening in some pretty darn hot paths. 
> But we've gone and added this overhead to a lot of architectures and
> configs which don't need it.
>
> Should we tighten that up?  Arrange for PageMemError() to evaluate to
> constant zero for all builds which don't actually implement "Migrate data
> off physical pages with correctable errors"?

Yes.

> Probably the way to implement that would be to add a new
> CONFIG_NEED_PAGE_MEM_ERROR and `select' that from the appropriate place in
> ia64 Kconfig.  Which is pretty nasty, but a) we're nasty that way rather
> often and b) this time it _is_ a hot-path, so some nastiness is
> justifiable.

Will do.

-- 
Russ Anderson, OS RAS/Partitioning Project Lead  
SGI - Silicon Graphics Inc          rja@sgi.com

  reply	other threads:[~2008-05-09 21:51 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-02  0:42 [PATCH 2/3] mm: Avoid putting a bad page back on the LRU v2 Russ Anderson
2008-05-02  0:42 ` Russ Anderson
2008-05-02  1:12 ` Christoph Lameter
2008-05-02  1:12   ` Christoph Lameter
2008-05-02  2:33   ` Russ Anderson
2008-05-02  2:33     ` Russ Anderson
2008-05-09 15:10 ` [PATCH 2/3] mm: Avoid putting a bad page back on the LRU v3 Russ Anderson
2008-05-09 15:10   ` Russ Anderson
2008-05-09 20:11   ` Andrew Morton
2008-05-09 20:11     ` Andrew Morton
2008-05-09 21:51     ` Russ Anderson [this message]
2008-05-09 21:51       ` Russ Anderson
2008-05-13 23:03 ` [PATCH 2/3] mm: Avoid putting a bad page back on the LRU v4 Russ Anderson
2008-05-13 23:03   ` Russ Anderson
2008-05-16 19:23 ` [PATCH 2/3] mm: Avoid putting a bad page back on the LRU v5 Russ Anderson
2008-05-16 19:23   ` Russ Anderson
2008-05-16 23:13   ` Christoph Lameter
2008-05-16 23:13     ` Christoph Lameter
2008-06-09 15:57     ` Russ Anderson
2008-06-09 15:57       ` Russ Anderson
2008-06-09 16:19 ` [PATCH 2/3] mm: Avoid putting a bad page back on the LRU v6 Russ Anderson
2008-06-09 16:19   ` Russ Anderson
2008-06-09 18:28   ` Christoph Lameter
2008-06-09 18:28     ` Christoph Lameter
2008-06-09 21:03     ` Russ Anderson
2008-06-09 21:03       ` Russ Anderson
2008-06-09 21:15       ` Christoph Lameter
2008-06-09 21:15         ` Christoph Lameter
2008-06-09 21:58 ` [PATCH 2/3] mm: Avoid putting a bad page back on the LRU v7 Russ Anderson
2008-06-09 21:58   ` Russ Anderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080509215116.GA32718@sgi.com \
    --to=rja@sgi.com \
    --cc=akpm@linux-foundation.org \
    --cc=clameter@sgi.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.