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

From: Andi Kleen
Date: Thu Jun 04 2009 - 05:19:30 EST


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@xxxxxxxxxxxxxxx -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/