From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86600C433DF for ; Thu, 25 Jun 2020 01:18:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 462CE20706 for ; Thu, 25 Jun 2020 01:18:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=intel-com.20150623.gappssmtp.com header.i=@intel-com.20150623.gappssmtp.com header.b="GkfLZv27" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 462CE20706 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A22636B0002; Wed, 24 Jun 2020 21:18:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9D34F6B0003; Wed, 24 Jun 2020 21:18:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8C15F6B0005; Wed, 24 Jun 2020 21:18:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0211.hostedemail.com [216.40.44.211]) by kanga.kvack.org (Postfix) with ESMTP id 7155B6B0002 for ; Wed, 24 Jun 2020 21:18:51 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id B845C181AC9CC for ; Thu, 25 Jun 2020 01:18:50 +0000 (UTC) X-FDA: 76965974820.02.yard24_0406ce926e48 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin02.hostedemail.com (Postfix) with ESMTP id 7257E100098A1ABA for ; Thu, 25 Jun 2020 01:18:50 +0000 (UTC) X-HE-Tag: yard24_0406ce926e48 X-Filterd-Recvd-Size: 7093 Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Thu, 25 Jun 2020 01:18:49 +0000 (UTC) Received: by mail-ej1-f68.google.com with SMTP id p20so4252353ejd.13 for ; Wed, 24 Jun 2020 18:18:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=S4SbnhufIhFwUeLYjq//w5IgB7McV3UjnK5Yim7wGXg=; b=GkfLZv27NlldN1p9efCfUh68aBGua1m/E0IDMwrhVAM9qK/647Os4nH8dIxNjhsOqc XxXafBFCNEkni9yD2TP5XvE7ucQKFj85hXPPaFpWvrggTcyjYUsSfbGpavynYgHF20QB hlFeF9e4YSjb7iIqqLLJdqKTR7iA1vLFyxN5P0AhRNsKwk04VsYSks82tS6V5D9AwRtH TTFpvgZ4coc54Wd695cp3TMTuco50/QjYEDuPPrRMLFWG/hFOFyc9yLCJ0QSotZtdDmw vHKJJ1zF4X3LlKWDr1wEbbDtZgeHTDmyDQjwexpJ0aq1yufduCIYKTQdqhxyI3m2N3Se ISrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=S4SbnhufIhFwUeLYjq//w5IgB7McV3UjnK5Yim7wGXg=; b=iL51yg9VVu85emd3Tkh4xvS3xz77D8ygQpwFMawoDcQmsHxZT4BKfhVYhr2EjxFMEe 2rLPMu6ewJIlp2i14NtPGi/IB1jnk0sKehMlaqAE+1qhY/UZPVjkw4Gn944l/2yxX957 u3xxoMix6x1OcqAjW4ExPq3Nc7lT4le7Lec/205TqD8pSTIe4171oIykuPtsmKCDNsNh a8UYGhAMzcb15BxvKW84UntvCDBqqvYLJW3Z1z26RxtZjiLCVGzW0qeYDc4TSYZKFnQn MOVF3b50CBjfET67BRGL03yYBbRHixlbObqiGL0amzAwUG7THRJXOQH/IKElFyJs01EQ PrcQ== X-Gm-Message-State: AOAM531jy8LKUvDMXCBMsWpTDZKiwEmnnENcajE3p4GdsakBtAb80KW2 8dWF8fH/ECfFJqYBKhmLHw7TDV649UMpjHLSwp4ZUg== X-Google-Smtp-Source: ABdhPJx7BojfkBEjdHBDZ426CyZlfaUL38+iK1GwoaIHiJf9eIxvBXchz95mC8yWN+jGnPuungCJl88pJiT/qc8CsXo= X-Received: by 2002:a17:906:f98e:: with SMTP id li14mr21127580ejb.174.1593047928170; Wed, 24 Jun 2020 18:18:48 -0700 (PDT) MIME-Version: 1.0 References: <20200623201745.GG21350@casper.infradead.org> <20200623220412.GA21232@agluck-desk2.amr.corp.intel.com> <20200623221741.GH21350@casper.infradead.org> <20200623222658.GA21817@agluck-desk2.amr.corp.intel.com> <20200623224027.GI21350@casper.infradead.org> <20200624000124.GH7625@magnolia> <20200624121000.GM21350@casper.infradead.org> <20200625001740.GX21350@casper.infradead.org> In-Reply-To: <20200625001740.GX21350@casper.infradead.org> From: Dan Williams Date: Wed, 24 Jun 2020 18:18:37 -0700 Message-ID: Subject: Re: [RFC] Make the memory failure blast radius more precise To: Matthew Wilcox Cc: "Darrick J. Wong" , "Luck, Tony" , Borislav Petkov , Naoya Horiguchi , linux-edac@vger.kernel.org, Linux MM , linux-nvdimm Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 7257E100098A1ABA X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000006, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Jun 24, 2020 at 5:17 PM Matthew Wilcox wrote: > > On Wed, Jun 24, 2020 at 04:21:24PM -0700, Dan Williams wrote: > > On Wed, Jun 24, 2020 at 5:10 AM Matthew Wilcox wrote: > > > On Tue, Jun 23, 2020 at 05:01:24PM -0700, Darrick J. Wong wrote: > > > > Frankly, I've wondered why the filesystem shouldn't just be in charge of > > > > all this-- > > > > > > > > 1. kernel receives machine check > > > > 2. kernel tattles to xfs > > > > 3. xfs looks up which file(s) own the pmem range > > > > 4. xfs zeroes the region, clears the poison, and sets AS_EIO on the > > > > files > > > > > > ... machine reboots, app restarts, gets no notification anything is wrong, > > > treats zeroed region as good data, launches nuclear missiles. > > > > Isn't AS_EIO stored persistently in the file block allocation map? > > No. AS_EIO is in mapping->flags. Unless Darrick was using "sets AS_EIO" > as shorthand for something else. > > > Even if it isn't today that is included in the proposal that the > > filesystem maintains a list of poison that is coordinated with the > > pmem driver. > > I'd like to see a concrete proposal here. There's still details to work through with respect to reflink. The latest discussion was that thread I linked about how to solve the page->index collision [1] for reverse mapping pages to files. [1]: https://lore.kernel.org/linux-ext4/20200311063942.GE10776@dread.disaster.area/ > > > > > Apps shouldn't have to do this punch-and-reallocate dance, seeing as > > > > they don't currently do that for SCSI disks and the like. > > > > > > The SCSI disk retains the error until the sector is rewritten. > > > I'm not entirely sure whether you're trying to draw an analogy with > > > error-in-page-cache or error-on-storage-medium. > > > > > > error-on-medium needs to persist until the app takes an affirmative step > > > to clear it. I presume XFS does not write zeroes to sectors with > > > errors on SCSI disks ... > > > > SCSI does not have an async mechanism to retrieve a list of poisoned > > blocks from the hardware (that I know of), pmem does. I really think > > we should not glom on pmem error handling semantics on top of the same > > infrastructure that it has handling volatile / replaceable pages. When > > Erm ... commit 6100e34b2526 has your name on it. Yes, and we're having this conversation because it turns out mm/memory-failure.c enabling for DAX is insufficient. > > > the filesystem is enabled to get involved it should impose a different > > model than generic memory error handling especially because generic > > memory-error handling has no chance to solve the reflink problem. > > > > If an application wants to survive poison consumption, signals seem > > only sufficient for interrupting an application that needs to take > > immediate action because one of its instructions was prevented from > > making forward progress. The interface for enumerating the extent of > > errors for DAX goes beyond what signinfo can reasonably convey, that > > piece is where the filesystem can be called to discover which file > > extents are impacted by poison. > > > > I like Darrick's idea that the kernel stabilizes the storage by > > default, and that the repair mechanism is just a write(2). I assume > > "stabilize" means make sure that the file offset is permanently > > recorded as poisoned until the next write(2), but read(2) and mmap(2) > > return errors so no more machine checks are triggered. > > That seems like something we'd want to work into the iomap infrastructure, > perhaps. Add an IOMAP_POISONED to indicate this range needs to be > written before it can be read? Yes, an explicit error state for an extent range is needed for the fs to offload the raw hardware poison list into software tracking.