public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Russ Anderson <rja@sgi.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Tony Luck <tony.luck@intel.com>
Subject: Re: [PATCH 3/3] ia64: Call migration code on correctable errors v2
Date: Thu, 1 May 2008 21:43:43 -0500	[thread overview]
Message-ID: <20080502024342.GB1591@sgi.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0805011818100.13527@schroedinger.engr.sgi.com>

On Thu, May 01, 2008 at 06:22:29PM -0700, Christoph Lameter wrote:
> On Thu, 1 May 2008, Russ Anderson wrote:
> 
> > +int
> > +freeOneBadPage(unsigned long paddr)
> > +{
> > +	struct page *page, *page2, *target;
> > +
> > +	/*
> > +	 * Verify page address
> > +	 */
> > +	target = phys_to_page(paddr);
> > +	list_for_each_entry_safe(page, page2, &badpagelist, lru) {
> > +		if (page != target)
> > +			continue;
> > +
> > +		ClearPageMemError(page);        /* Mark the page as good */
> > +		move_to_lru(page);
> > +		list_del(&page->lru);
> 
> This is the wrong order. move_to_lru() uses the lru field. So do the 
> list_del first then the move. Note that there is a function 
> putback_lru_pages() that is used to put a list of pages back to the lru if 
> migration has failed and we give up on them. Could you use 
> putback_lru_pages() and then avoid the exporting of move_to_lru()?

I'll put the page on a different list and call putback_lru_pages().

> > +
> > +int
> > +freeAllBadPages(void)
> > +{
> > +	struct page *page, *page2;
> > +
> > +	list_for_each_entry_safe(page, page2, &badpagelist, lru) {
> > +		ClearPageMemError(page);        /* Mark the page as good */
> > +		totalbad_pages--;
> > +	}
> > +	putback_lru_pages(&badpagelist);
> > +	return 0;
> > +}
> 
> Ahh.. Here you use it.

This is when deleting all the pages on the list.

> > Index: linus/include/asm-ia64/page.h
> > ===================================================================
> > --- linus.orig/include/asm-ia64/page.h	2008-05-01 19:36:40.000000000 -0500
> > +++ linus/include/asm-ia64/page.h	2008-05-01 19:36:49.000000000 -0500
> > @@ -122,6 +122,7 @@ extern unsigned long max_low_pfn;
> >  #endif
> >  
> >  #define page_to_phys(page)	(page_to_pfn(page) << PAGE_SHIFT)
> > +#define	phys_to_page(kaddr)	(pfn_to_page(kaddr >> PAGE_SHIFT))
> 
> #define phys_to_page virt_to_page ?

I'm not sure what you are asking.

#define phys_to_page(kaddr)     (pfn_to_page(kaddr >> PAGE_SHIFT))
#define virt_to_page(kaddr)     pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)

Do you mean change virt_to_page() like this?

#define virt_to_page(kaddr)     phys_to_page(__pa(kaddr))

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

  reply	other threads:[~2008-05-02  2:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-02  0:44 [PATCH 3/3] ia64: Call migration code on correctable errors v2 Russ Anderson
2008-05-02  1:22 ` Christoph Lameter
2008-05-02  2:43   ` Russ Anderson [this message]
2008-05-02  9:58 ` Pekka Enberg
2008-05-02 16:40   ` Russ Anderson
2008-05-02 16:57     ` Pekka J Enberg
2008-05-02 17:30       ` Russ Anderson
2008-05-02 17:45 ` Andi Kleen
2008-05-02 18:50   ` Russ Anderson
2008-05-02 19:33     ` Andi Kleen
2008-05-02 20:27       ` 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=20080502024342.GB1591@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox