Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp590224pxf; Wed, 24 Mar 2021 11:01:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUTgYrA7V4/hG7mArIPGyJusSf9DlxTUpIPhWiUlsbRFAZiCrOak9hq4sf5wWDNFTggRN5 X-Received: by 2002:a05:6402:5211:: with SMTP id s17mr4813903edd.327.1616608916154; Wed, 24 Mar 2021 11:01:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616608916; cv=none; d=google.com; s=arc-20160816; b=oj17Q+cTUcckhb9DNS+MwzzS1WU/B3DaUaMpiEVg3yGQu5ihzSzmUd7blzoftCw7ie MvFU1Uv0iGPtUkqPfncU9Lrv7OBeJ/0oF4KFa4OeVugoFEa2O3o1VQ973+r4ONHxcVwE jrrjOkbLI2cFUZKIjPXY/z5PPsKpLQ/V68HnuslYUFCtRVslt17+7AtNvyPAI3BSqP2l Y7SX01ao3UM7Bi34L6wCZKUHCSZotyXNJ4RanW97UNfKJnOllHnZkb/jegMrLBFtmrFw sXHutwVzedNvvVvmxNQcZWvvsuAd0wjfl7uAVUhtvMHoXwz/LTJuDS3N78a/OFNOHN2T gXEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=2KFNkl1or0mmtXA1jvsRAF0OANfT9njIYX+exK4jOos=; b=VILQz/xRdvUBSW1LYTFK1KHyACZhamGTOJZT4P4JJStMmMX/Xzb0zuTHvWWmWTugq8 waXNrtC5jB9RqqHTw60qoDDg/ldt7jSPzbQYf+wWSZ7x07tIruTgLL8bSdR+pO/QsGvZ A/OYXkUfci5bvd7ZKN1pWCETIiXxD/+qPP45u14MzePBaTqHk1uXAxr65A0mFO9MfsyF Dz/ydJMI1ud/OMU9OT/Ead9a4uPtl/resY2gM2a5f3JcD+5h/mKXXds9nk3obDldghqL W05FcXbmr8itYRItklYH96tWgcl2Rpi2t0UjfVZupjhUBlVHX7Am+IH4nfR6zwrEUBd3 R6RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=vFzEiq5f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p25si2204027edm.297.2021.03.24.11.01.30; Wed, 24 Mar 2021 11:01:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=vFzEiq5f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232618AbhCXSA3 (ORCPT + 99 others); Wed, 24 Mar 2021 14:00:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236683AbhCXSA3 (ORCPT ); Wed, 24 Mar 2021 14:00:29 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9597C0613DF for ; Wed, 24 Mar 2021 11:00:28 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id kt15so24906636ejb.12 for ; Wed, 24 Mar 2021 11:00:28 -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=2KFNkl1or0mmtXA1jvsRAF0OANfT9njIYX+exK4jOos=; b=vFzEiq5fNjCN/7R0WwqtTXBrQesBMnmm7Yt0aIk36IUzb9nz2Iwwjuku88ov5xGoo7 I2nZHiAzvvorrWHog5G+fz0o6Iwgp6fPe5BX5ALrKM8J8rriLQBF2bQ6iQmCTySTWQeW U//yvsIy1PSHAhs/SX8wnQHVLy4lhbL9aV+PelAq1xjXUrvVSvyfV6E/eLWQI3REFqaQ He1p0+EQfwXwRd5c1XOplbo7llR+YgnDVh0Qw+Ot0l9QZsjaixzo1kAkhZJUMzGxY+ki n7X09BFlfP5Sp9r65op8Vg3Ww+4V6SnFtzm8Ym0iKZ0MacVqsqNvp80/mc20puyxivuG ceGw== 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=2KFNkl1or0mmtXA1jvsRAF0OANfT9njIYX+exK4jOos=; b=b4tnB3EkS+0M5Y1ZwfuB3EOuMtxIjD4SUBDbPHQqA/IfOrGPXgFPMXa3KBh8VcuF7k at/p4FXtZX2FcrcglAGIPQyNjXkLEXpJ4JidxcfgCjfGoihvQ1bUZAWFm5DSlJnOWnPu dA7lNdX086mj44aqQvalAl+pw+Z5qGi05Qh/4YC+loq3pUNKA86vaLL0w8EbmUxa/qyq MsXE8ZTF0E5OdL2XYKU06oAa1z6tFIIEQeij1Qs+NDxCcG10Stkc6VkJ/90cI7L5gKg2 zeRPwefeIHvyS6KnKhq8nLT8BDcQlwYcnyykrVAprC7oQKRBm2FyutRqaF/384FfaqHb 5J1A== X-Gm-Message-State: AOAM53286gCzZ1zigzhcQOaGlVlXEcQ8NeWnqQg7YLMcNVnHN/sK2I+L tjfe88GSYpq3JNHYfPo/ZGfQxXEUF5kQEILO5BruSQ== X-Received: by 2002:a17:906:8447:: with SMTP id e7mr5154772ejy.523.1616608827202; Wed, 24 Mar 2021 11:00:27 -0700 (PDT) MIME-Version: 1.0 References: <20210324074751.GA1630@lst.de> <20210324173935.GB12770@lst.de> In-Reply-To: <20210324173935.GB12770@lst.de> From: Dan Williams Date: Wed, 24 Mar 2021 11:00:16 -0700 Message-ID: Subject: Re: [PATCH v3 01/11] pagemap: Introduce ->memory_failure() To: Christoph Hellwig Cc: "ruansy.fnst@fujitsu.com" , Linux Kernel Mailing List , linux-xfs , linux-nvdimm , Linux MM , linux-fsdevel , device-mapper development , "Darrick J. Wong" , david , Alasdair Kergon , Mike Snitzer , Goldwyn Rodrigues , "qi.fuli@fujitsu.com" , "y-goto@fujitsu.com" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 24, 2021 at 10:39 AM Christoph Hellwig wrote: > > On Wed, Mar 24, 2021 at 09:37:01AM -0700, Dan Williams wrote: > > > Eww. As I said I think the right way is that the file system (or > > > other consumer) can register a set of callbacks for opening the device. > > > > How does that solve the problem of the driver being notified of all > > pfn failure events? > > Ok, I probably just showed I need to spend more time looking at > your proposal vs the actual code.. > > Don't we have a proper way how one of the nvdimm layers own a > spefific memory range and call directly into that instead of through > a notifier? So that could be a new dev_pagemap operation as Ruan has here. I was thinking that other agents would be interested in non-dev_pagemap managed ranges, but we could leave that for later and just make the current pgmap->memory_failure() callback proposal range based. > > > Today pmem only finds out about the ones that are > > notified via native x86 machine check error handling via a notifier > > (yes "firmware-first" error handling fails to do the right thing for > > the pmem driver), > > Did any kind of firmware-first error handling ever get anything > right? I wish people would have learned that by now. Part of me wants to say if you use firmware-first you get to keep the pieces, but it's not always the end user choice as far as I understand. > > or the ones that are eventually reported via address > > range scrub, but only for the nvdimms that implement range scrubbing. > > memory_failure() seems a reasonable catch all point to route pfn > > failure events, in an arch independent way, to interested drivers. > > Yeah. > > > I'm fine swapping out dax_device blocking_notiier chains for your > > proposal, but that does not address all the proposed reworks in my > > list which are: > > > > - delete "drivers/acpi/nfit/mce.c" > > > > - teach memory_failure() to be able to communicate range failure > > > > - enable memory_failure() to defer to a filesystem that can say > > "critical metadata is impacted, no point in trying to do file-by-file > > isolation, bring the whole fs down". > > This all sounds sensible. Ok, Ruan, I think this means rework your dev_pagemap_ops callback to be range based. Add a holder concept for dax_devices and then layer that on Christoph's eventual dax_device callback mechanism that a dax_device holder can register.