Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2336260pxb; Thu, 4 Nov 2021 18:51:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDjTk+0uXzNsQb48hwQN0SJJNrVckTlswHM9AKsOG6vpYNyzDJ/Ws7cce4l+GN3BSsycV/ X-Received: by 2002:a05:6402:c18:: with SMTP id co24mr66044070edb.278.1636077109822; Thu, 04 Nov 2021 18:51:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636077109; cv=none; d=google.com; s=arc-20160816; b=K2g0OrEIN73lN5sLNJ443HenYrmVAOe9gDzL4JiWyMgGiKM4Z7Sw+QKkhE0tMIFz9o otRslhwX8bj8Y39pqNAXSIXrJ8VI9SVB1Co356Fr0HpJj3EFaZH/X3KU4BFzXPJcYh4M TTOzLyvIkq4mASmN1KfgJ3h5qiRBn+uESuB4IhWSEFjQ5ciGaV1zUtta1YYtOGwNcisi RFODEqt6SNk67MiJFUAzKtuSetSG82cz+MRkLDoMM4i5slBk3UKUuJu2U2Wuu4GdwzJ+ WF8Ph/n33aX3stVJI8fuT7nFfaKzgWeQFhnACemLuDMs81KQ/9qlqiZD6gBmaS/G7GOE 2NlQ== 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=q+r8LSqikMIilQXxN0nyoS2okHlFhIR7lspEguCYFa0=; b=EYH+KA+nkYhWrt9/ETMm0X0Wj7uvsILWLvwwRgX68Vtugj7jDFaCOmP6qYRqFNv7HG g/OY6/2A/zMsxO4fQ9wgYEsPc1/d9h0cm6rzH83jgfGHIpVKYhVIYqKGGo2q1ePAUdNq VPyxRy8MLfHmMI5OlLWRBl2JrzQSm2fOXx3WN/5GyDHZL2xu17HztM0PUflLALGX3uEH 0QAut2iwTYJWNXBLvfGJ+C9uZXMRjJ/KjWbeZVBGJWK6MqACShJPLU6pSj1+Btarv1C7 OnQoYLlJP6trzEBAFKve5/c5Iv6vxFtKHOs2pVgph14t+gnyxVXxR1btZOPH8XDiFDw7 hqng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20210112.gappssmtp.com header.s=20210112 header.b=KLVm3GA6; 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 n1si10439204edb.104.2021.11.04.18.51.26; Thu, 04 Nov 2021 18:51:49 -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.20210112.gappssmtp.com header.s=20210112 header.b=KLVm3GA6; 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 S231253AbhKEBiA (ORCPT + 99 others); Thu, 4 Nov 2021 21:38:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231236AbhKEBh6 (ORCPT ); Thu, 4 Nov 2021 21:37:58 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B341EC061203 for ; Thu, 4 Nov 2021 18:35:19 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id v20so10106346plo.7 for ; Thu, 04 Nov 2021 18:35:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=q+r8LSqikMIilQXxN0nyoS2okHlFhIR7lspEguCYFa0=; b=KLVm3GA6EsbW5lEpuwpZ3bWD6edBgWdpThXC4PmysSycODxJwt5aPWM1XdIVyt70zu zZIHLob5VTFB9bMKtsocBIHuMWtEGqLgep6Tbyo0WB13vQk+cj0f3t+LvnnrI8N70mw0 RscuxQHCCpaQ8++RuGokESm1xDmRYn5KNzgEU+yZ5WdY0lvEDWGa9+kubM4yGg9feP2j bNpHUGc8OzE5F5KOK1fwG0rEzCe6coKb2u4symBRKNTBmRihxTEtYbKfFmvBvRPRT4L8 7O43kfBZEMbQCJxm4+KrWJq/mnjFySFMlWS+pBDNe2DMB/vMhyBzkrBZEcat78XUaQE0 EW2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=q+r8LSqikMIilQXxN0nyoS2okHlFhIR7lspEguCYFa0=; b=i2X3SmzkUyi1H/6lL7brjRQqtfCY/5M1n0Ij8E7A19t+PAv5OD7u8KQ+/WFkC4wxUT 5MypNZwwdwdGUynBGRJhI7m5BmrWxQeVVUvp0zgSYJ808X30r8Ijgfg8BFuEcvTBlyFF 6ugFvbxKgFwzzwwfPWGEBrAUxn2Ajm5l1LyPQErNXmqKMvI0jw17/4GZAGadSsmA/S/5 FTT8rXeRdrM3TtO9v+2eqNaPtDFqR+c5fSzXRjAmSmHuXAAEOuQIfomIR74dZYz+so3T nPjVwx2V2FH/01YaEGoE+aIOE76HZcJKlQnhaA7AFB6oTKW+JDRpM+FOP5zyI1e00hUi grtQ== X-Gm-Message-State: AOAM531QcmvafkEDL++gI1oJB+B7v49pVEdf7dR+Skh/tDqekAv31O89 JHuEA32l2nkV3qfhwpm5ON/rn5Qcw9lB+AZpmperJg== X-Received: by 2002:a17:90b:1e49:: with SMTP id pi9mr3596462pjb.220.1636076119266; Thu, 04 Nov 2021 18:35:19 -0700 (PDT) MIME-Version: 1.0 References: <2102a2e6-c543-2557-28a2-8b0bdc470855@oracle.com> <20211028002451.GB2237511@magnolia> <6d21ece1-0201-54f2-ec5a-ae2f873d46a3@oracle.com> <342eb71c-0aff-77e5-3c71-92224d7d48e0@oracle.com> In-Reply-To: From: Dan Williams Date: Thu, 4 Nov 2021 18:35:08 -0700 Message-ID: Subject: Re: [dm-devel] [PATCH 0/6] dax poison recovery with RWF_RECOVERY_DATA flag To: Jane Chu Cc: Christoph Hellwig , "Darrick J. Wong" , "david@fromorbit.com" , "vishal.l.verma@intel.com" , "dave.jiang@intel.com" , "agk@redhat.com" , "snitzer@redhat.com" , "dm-devel@redhat.com" , "ira.weiny@intel.com" , "willy@infradead.org" , "vgoyal@redhat.com" , "linux-fsdevel@vger.kernel.org" , "nvdimm@lists.linux.dev" , "linux-kernel@vger.kernel.org" , "linux-xfs@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 4, 2021 at 5:46 PM Dan Williams wrote: > > On Thu, Nov 4, 2021 at 1:27 PM Jane Chu wrote: > > > > On 11/4/2021 12:00 PM, Dan Williams wrote: > > > > >> > > >> If this understanding is in the right direction, then I'd like to > > >> propose below changes to > > >> dax_direct_access(), dax_copy_to/from_iter(), pmem_copy_to/from_iter() > > >> and the dm layer copy_to/from_iter, dax_iomap_iter(). > > >> > > >> 1. dax_iomap_iter() rely on dax_direct_access() to decide whether there > > >> is likely media error: if the API without DAX_F_RECOVERY returns > > >> -EIO, then switch to recovery-read/write code. In recovery code, > > >> supply DAX_F_RECOVERY to dax_direct_access() in order to obtain > > >> 'kaddr', and then call dax_copy_to/from_iter() with DAX_F_RECOVERY. > > > > > > I like it. It allows for an atomic write+clear implementation on > > > capable platforms and coordinates with potentially unmapped pages. The > > > best of both worlds from the dax_clear_poison() proposal and my "take > > > a fault and do a slow-path copy". > > > > > >> 2. the _copy_to/from_iter implementation would be largely the same > > >> as in my recent patch, but some changes in Christoph's > > >> 'dax-devirtualize' maybe kept, such as DAX_F_VIRTUAL, obviously > > >> virtual devices don't have the ability to clear poison, so no need > > >> to complicate them. And this also means that not every endpoint > > >> dax device has to provide dax_op.copy_to/from_iter, they may use the > > >> default. > > > > > > Did I miss this series or are you talking about this one? > > > https://lore.kernel.org/all/20211018044054.1779424-1-hch@lst.de/ > > > > I was referring to > > > > http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/dax-devirtualize > > that has not come out yet, I said early on that I'll rebase on it, > > but looks like we still need pmem_copy_to/from_iter(), so. > > Yeah, since the block-layer divorce gets rid of the old poison > clearing path, then we're back to pmem_copy_to_iter() (or something > like it) needing to pick up the slack for poison clearing. I do agree > it would be nice to clean up all the unnecessary boilerplate, but the > error-list coordination requires a driver specific callback. At least > the DAX_F_VIRTUAL flag can eliminate the virtiofs and fuse callbacks. Although, if error management is generically implemented relative to a 'struct dax_device' then there wouldn't be a need to call all the way back into the driver, and the cleanup could still move forward.