From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail138.messagelabs.com (mail138.messagelabs.com [216.82.249.35]) by kanga.kvack.org (Postfix) with SMTP id BA42E6B004F for ; Mon, 15 Jun 2009 20:03:23 -0400 (EDT) Received: by pxi40 with SMTP id 40so840131pxi.12 for ; Mon, 15 Jun 2009 17:03:26 -0700 (PDT) Date: Tue, 16 Jun 2009 09:03:08 +0900 From: Minchan Kim Subject: Re: [PATCH 09/22] HWPOISON: Handle hardware poisoned pages in try_to_unmap Message-Id: <20090616090308.bac3b1f7.minchan.kim@barrios-desktop> In-Reply-To: <20090615152612.GA11700@localhost> References: <20090615024520.786814520@intel.com> <20090615031253.530308256@intel.com> <28c262360906150609gd736bf7p7a57de1b81cedd97@mail.gmail.com> <20090615152612.GA11700@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: owner-linux-mm@kvack.org To: Wu Fengguang Cc: Minchan Kim , Andrew Morton , LKML , Andi Kleen , Ingo Molnar , Mel Gorman , Thomas Gleixner , "H. Peter Anvin" , Peter Zijlstra , Nick Piggin , Hugh Dickins , Andi Kleen , "riel@redhat.com" , "chris.mason@oracle.com" , "linux-mm@kvack.org" List-ID: On Mon, 15 Jun 2009 23:26:12 +0800 Wu Fengguang wrote: > On Mon, Jun 15, 2009 at 09:09:03PM +0800, Minchan Kim wrote: > > On Mon, Jun 15, 2009 at 11:45 AM, Wu Fengguang wrote: > > > From: Andi Kleen > > > > > > When a page has the poison bit set replace the PTE with a poison entry. > > > This causes the right error handling to be done later when a process runs > > > into it. > > > > > > Also add a new flag to not do that (needed for the memory-failure handler > > > later) > > > > > > Reviewed-by: Wu Fengguang > > > Signed-off-by: Andi Kleen > > > > > > --- > > > A include/linux/rmap.h | A A 1 + > > > A mm/rmap.c A A A A A A | A A 9 ++++++++- > > > A 2 files changed, 9 insertions(+), 1 deletion(-) > > > > > > --- sound-2.6.orig/mm/rmap.c > > > +++ sound-2.6/mm/rmap.c > > > @@ -958,7 +958,14 @@ static int try_to_unmap_one(struct page > > > A A A A /* Update high watermark before we lower rss */ > > > A A A A update_hiwater_rss(mm); > > > > > > - A A A if (PageAnon(page)) { > > > + A A A if (PageHWPoison(page) && !(flags & TTU_IGNORE_HWPOISON)) { > > > + A A A A A A A if (PageAnon(page)) > > > + A A A A A A A A A A A dec_mm_counter(mm, anon_rss); > > > + A A A A A A A else if (!is_migration_entry(pte_to_swp_entry(*pte))) > > > > Isn't it straightforward to use !is_hwpoison_entry ? > > Good catch! It looks like a redundant check: the > page_check_address() at the beginning of the function guarantees that > !is_migration_entry() or !is_migration_entry() tests will all be TRUE. > So let's do this? It seems you expand my sight :) I don't know migration well. How page_check_address guarantee it's not migration entry ? In addtion, If the page is poison while we are going to migration((PAGE_MIGRATION && migration) == TRUE), we should decrease file_rss ? > > - A A A A A A A else if (!is_migration_entry(pte_to_swp_entry(*pte))) > + A A A A A A A else > > > Thanks, > Fengguang -- Kinds Regards Minchan Kim -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org