From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762605AbZFOP0y (ORCPT ); Mon, 15 Jun 2009 11:26:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755507AbZFOP0p (ORCPT ); Mon, 15 Jun 2009 11:26:45 -0400 Received: from mga03.intel.com ([143.182.124.21]:42591 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755022AbZFOP0o (ORCPT ); Mon, 15 Jun 2009 11:26:44 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.42,223,1243839600"; d="scan'208";a="154519215" Date: Mon, 15 Jun 2009 23:26:12 +0800 From: Wu Fengguang To: Minchan Kim Cc: 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" Subject: Re: [PATCH 09/22] HWPOISON: Handle hardware poisoned pages in try_to_unmap Message-ID: <20090615152612.GA11700@localhost> References: <20090615024520.786814520@intel.com> <20090615031253.530308256@intel.com> <28c262360906150609gd736bf7p7a57de1b81cedd97@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <28c262360906150609gd736bf7p7a57de1b81cedd97@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > > > --- > >  include/linux/rmap.h |    1 + > >  mm/rmap.c            |    9 ++++++++- > >  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 > >        /* Update high watermark before we lower rss */ > >        update_hiwater_rss(mm); > > > > -       if (PageAnon(page)) { > > +       if (PageHWPoison(page) && !(flags & TTU_IGNORE_HWPOISON)) { > > +               if (PageAnon(page)) > > +                       dec_mm_counter(mm, anon_rss); > > +               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? -               else if (!is_migration_entry(pte_to_swp_entry(*pte))) +               else Thanks, Fengguang