Re: [PATCH] [13/16] HWPOISON: The high level memory error handler in the VM v5

Andi Kleen
2009-06-04T09:19:26Z

On Thu, Jun 04, 2009 at 05:07:37PM +0800, Wu Fengguang wrote:
>
> > > > + * need this to decide if we should kill or just drop the page.
> > > > + */
> > > > + mapping = page_mapping(p);
> > > > + if (!PageDirty(p) && !PageAnon(p) && !PageSwapBacked(p) &&
> > >
> > > !PageAnon(p) could be removed: the below non-zero mapping check will
> > > do the work implicitly.
> >
> > You mean !page_mapped? Ok.
>
> I mean to do
> mapping = page_mapping(p);
> if (!PageDirty(p) && !PageSwapBacked(p) &&
> mapping && mapping_cap_account_dirty(mapping)) {
>
> Because for anonymous pages, page_mapping == NULL.

I realized this after pressing send. Anyways the PageAnon is dropped
>
> --- sound-2.6.orig/mm/memory-failure.c
> +++ sound-2.6/mm/memory-failure.c
> @@ -660,6 +660,10 @@ static void hwpoison_user_mappings(struc
> break;
> pr_debug("MCE %#lx: try_to_unmap retry needed %d\n", pfn, ret);
> }
> + if (ret != SWAP_SUCCESS)
> + printk(KERN_ERR
> + "MCE %#lx: failed to unmap page (mapcount=%d)!\n",
> + pfn, page_mapcount(p));

Ok.

-Andi

--
ak@linux.intel.com -- Speaking for myself only.