From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762213AbZFRNb6 (ORCPT ); Thu, 18 Jun 2009 09:31:58 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759441AbZFRNbu (ORCPT ); Thu, 18 Jun 2009 09:31:50 -0400 Received: from mail-gx0-f214.google.com ([209.85.217.214]:57106 "EHLO mail-gx0-f214.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751396AbZFRNbu convert rfc822-to-8bit (ORCPT ); Thu, 18 Jun 2009 09:31:50 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Bs/RQTBAh8Cv9hw0mzjS7yuqmUkuaXaAGsNfwAvhAUipLpgIUw6XUQ3HKgB9+YYmGC Wme+y/11iSmuSH+di5Yu71SnoVHKzoObfFF+ss3pfIRR8z1rzoAPj7zYtTmkm16w3lgs zizUqxduPwswFHMSwwt9D3boci3vjnWnVe2mg= MIME-Version: 1.0 In-Reply-To: <20090618121430.GA6746@localhost> References: <20090615031253.530308256@intel.com> <20090615152612.GA11700@localhost> <20090616090308.bac3b1f7.minchan.kim@barrios-desktop> <20090616134944.GB7524@localhost> <20090617092826.56730a10.minchan.kim@barrios-desktop> <20090617072319.GA5841@localhost> <28c262360906170644w65c08a8y2d2805fb08045804@mail.gmail.com> <20090617135543.GA8079@localhost> <28c262360906170703h3363b68dp74471358f647921e@mail.gmail.com> <20090618121430.GA6746@localhost> Date: Thu, 18 Jun 2009 22:31:52 +0900 Message-ID: <28c262360906180631i25ea6a18mbdc5be31c2346c04@mail.gmail.com> Subject: Re: [PATCH 09/22] HWPOISON: Handle hardware poisoned pages in try_to_unmap From: Minchan Kim To: Wu Fengguang 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" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 18, 2009 at 9:14 PM, Wu Fengguang wrote: > On Wed, Jun 17, 2009 at 10:03:37PM +0800, Minchan Kim wrote: >> On Wed, Jun 17, 2009 at 10:55 PM, Wu Fengguang wrote: >> > On Wed, Jun 17, 2009 at 09:44:39PM +0800, Minchan Kim wrote: >> >> It is private mail for my question. >> >> I don't want to make noise in LKML. >> >> And I don't want to disturb your progress to merge HWPoison. >> >> >> >> > Because this race window is small enough: >> >> > >> >> >        TestSetPageHWPoison(p); >> >> >                                   lock_page(page); >> >> >                                   try_to_unmap(page, TTU_MIGRATION|...); >> >> >        lock_page_nosync(p); >> >> > >> >> > such small race windows can be found all over the kernel, it's just >> >> > insane to try to fix any of them. >> >> >> >> I don't know there are intentional small race windows in kernel until you said. >> >> I thought kernel code is perfect so it wouldn't allow race window >> >> although it is very small. But you pointed out. Until now, My thought >> >> is wrong. >> >> >> >> Do you know else small race windows by intention ? >> >> If you know it, tell me, please. It can expand my sight. :) >> > >> > The memory failure code does not aim to rescue 100% page corruptions. >> > That's unreasonable goal - the kernel pages, slab pages (including the >> > big dcache/icache) are almost impossible to isolate. >> > >> > Comparing to the big slab pools, the migration and other race windows are >> > really too small to care about :) >> >> Also, If you will mention this contents as annotation, I will add my >> review sign. > > Good suggestion. Here is a patch for comment updates. > >> Thanks for kind reply for my boring discussion. > > Boring? Not at all :) > > Thanks, > Fengguang > > --- >  mm/memory-failure.c |   76 +++++++++++++++++++++++++----------------- >  1 file changed, 47 insertions(+), 29 deletions(-) > > --- sound-2.6.orig/mm/memory-failure.c > +++ sound-2.6/mm/memory-failure.c > @@ -1,4 +1,8 @@ >  /* > + * linux/mm/memory-failure.c > + * > + * High level machine check handler. > + * >  * Copyright (C) 2008, 2009 Intel Corporation >  * Authors: Andi Kleen, Fengguang Wu >  * > @@ -6,29 +10,36 @@ >  * the GNU General Public License ("GPL") version 2 only as published by the >  * Free Software Foundation. >  * > - * High level machine check handler. Handles pages reported by the > - * hardware as being corrupted usually due to a 2bit ECC memory or cache > - * failure. > - * > - * This focuses on pages detected as corrupted in the background. > - * When the current CPU tries to consume corruption the currently > - * running process can just be killed directly instead. This implies > - * that if the error cannot be handled for some reason it's safe to > - * just ignore it because no corruption has been consumed yet. Instead > - * when that happens another machine check will happen. > - * > - * Handles page cache pages in various states. The tricky part > - * here is that we can access any page asynchronous to other VM > - * users, because memory failures could happen anytime and anywhere, > - * possibly violating some of their assumptions. This is why this code > - * has to be extremely careful. Generally it tries to use normal locking > - * rules, as in get the standard locks, even if that means the > - * error handling takes potentially a long time. > - * > - * The operation to map back from RMAP chains to processes has to walk > - * the complete process list and has non linear complexity with the number > - * mappings. In short it can be quite slow. But since memory corruptions > - * are rare we hope to get away with this. > + * Pages are reported by the hardware as being corrupted usually due to a > + * 2bit ECC memory or cache failure. Machine check can either be raised when > + * corruption is found in background memory scrubbing, or when someone tries to > + * consume the corruption. This code focuses on the former case.  If it cannot > + * handle the error for some reason it's safe to just ignore it because no > + * corruption has been consumed yet. Instead when that happens another (deadly) > + * machine check will happen. > + * > + * The tricky part here is that we can access any page asynchronous to other VM > + * users, because memory failures could happen anytime and anywhere, possibly > + * violating some of their assumptions. This is why this code has to be > + * extremely careful. Generally it tries to use normal locking rules, as in get > + * the standard locks, even if that means the error handling takes potentially > + * a long time. > + * > + * We don't aim to rescue 100% corruptions. That's unreasonable goal - the > + * kernel text and slab pages (including the big dcache/icache) are almost > + * impossible to isolate. We also try to keep the code clean by ignoring the > + * other thousands of small corruption windows. other thousands of small corruption windows(ex, migration, ...) As far as you know , please write down them. Anyway, I already added my sign. Thanks for your effort never get exhausted. :) -- Kinds regards, Minchan Kim