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=-3.8 required=3.0 tests=BAYES_00,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 EC3D0C433E0 for ; Wed, 24 Mar 2021 18:00:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8011061A1A for ; Wed, 24 Mar 2021 18:00:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8011061A1A 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 F182C6B02DF; Wed, 24 Mar 2021 14:00:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ECB296B02E1; Wed, 24 Mar 2021 14:00:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D19E56B02E4; Wed, 24 Mar 2021 14:00:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0133.hostedemail.com [216.40.44.133]) by kanga.kvack.org (Postfix) with ESMTP id B61B26B02DF for ; Wed, 24 Mar 2021 14:00:29 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 65F271836C64F for ; Wed, 24 Mar 2021 18:00:29 +0000 (UTC) X-FDA: 77955532578.19.94DC3BF Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by imf24.hostedemail.com (Postfix) with ESMTP id E9FCCA001A82 for ; Wed, 24 Mar 2021 18:00:26 +0000 (UTC) Received: by mail-ej1-f54.google.com with SMTP id e14so16160505ejz.11 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=fofYvo8ejM+7zxD80Y0DTzh3VD1amMxDT5L9eQfKKHO8PnowkkzBY8pN7mNsBplKVc Tl0y2hQK86LwroYrYe9hLcYJ/cLXvh+Nt/Sf4RUfml7ESYHTQTes5A3hsjqqjYDRI/E2 28MBiBdRxOE8Clg6m7J+cMFQVxhvm5sR3Z4Wd8TpJAdjQN8jq47NLLrbV906dtXKlJr+ /RezPEWUnIsRfkfwN4FQZnwtSzdVdYjhiXt7DUxuYW+7zwTOI6BwaXJ9gAlJGgEalQxA oDmfODbJVO2PQXwx2uNBt1eXbL5J7lq6zbBsKKCNRGSjDeaLbQf2+gPCzVd3XO81zyHv 8Zjw== X-Gm-Message-State: AOAM531D0vxgE+AoVWW5TWPmnREWpxU36RhgbM+Au+Ng5gE5mZWfiVdk hJtWNOeQ+3kCIw3nrC6C3km2LYWx8oE4u91wrJt8hA== X-Google-Smtp-Source: ABdhPJy9J40IqLa/d+cck6PXVVGYBFPLo6iqEOA+v2R4s6asbN5wOCf5ZJ6fNNbFdsT8bCsuZH/tAzIMp5hm7zOGEdw= 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" X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: E9FCCA001A82 X-Stat-Signature: 1gar3qa3rzerbf5h7mehmd9bsrypacox Received-SPF: none (intel.com>: No applicable sender policy available) receiver=imf24; identity=mailfrom; envelope-from=""; helo=mail-ej1-f54.google.com; client-ip=209.85.218.54 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1616608826-213827 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.