Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2319587pxb; Thu, 4 Nov 2021 18:29:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4Z/cU4l5Q7nW2qKYnhLkrnY1cYqL30Of8yhqV7ROLufLJfXH49esBT/Wg9jxdfr2z8MdG X-Received: by 2002:a05:6e02:12c7:: with SMTP id i7mr30572877ilm.253.1636075741230; Thu, 04 Nov 2021 18:29:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636075741; cv=none; d=google.com; s=arc-20160816; b=SBZCqb5/1GcUVpJfuc3GgK9KSSZcN2tjOpoMZgGPuqqWJUL2MHe7pdn+9sLh0ZZNm1 y29WS+g2uSbhCAKKFGT3kqSVAIaS6TQHqLaQDrojAzeXkP/675ut3aaXYSnbb2+EW4Hm KA0LnB5VlFiXmiFrEy74vJfLURrVYWC/ItHoJeEOjlBu/DZ+YCqlcP0wY1Uggzm0pMkV z3PjtD8IMm5ZE+IY7BpITWizF7K0AEiK4PVKEt4BpSMdjhpBAMpJjnx2J3mUvlXq2ncc MMmSzZLbl5dmCP6Y8g6Qg1ZKpa/lTj/aAusumJM0mSHmSTTF8TSgExOljWYR4OTkVokn ZBfg== 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=+MDx1GrQOub7zJ6Bty8NHKGO6IrOVwg4Q81dxTNGuQk=; b=0GJapv6rzGRtWreuLO4/z/WUKFq1mQeeWbpODmpqrTPdwDcO8y9JhVU/NM1vDJDzlH IOCcm33vDMHjalL3faQjOkGNo3u+Y4gs/wtf+zydT0HEEEAK6QLGYFCg6S4C5HKDgXIV MBgx+8bm4Fr6nsLXLNdhWhYtJJ/suuBxeZstGPXXFrpvruKUjU1MGg9+6OkmSX05HFw1 tpo4y5NE6bElfbvALS4eYooO29MbMDTT9usSzcf69GtTrABOkanl5YrZemp7GPomF+Ml CK/GulOz4pJmzH0mWSr0AtugrApSw9iw7Z/SgNnDxvEvmH94APlsWbc5EO/H4kRTOpd8 gogg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20210112.gappssmtp.com header.s=20210112 header.b="z1/ZhSMb"; 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 p8si10883776ilh.169.2021.11.04.18.28.46; Thu, 04 Nov 2021 18:29:01 -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="z1/ZhSMb"; 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 S230353AbhKEAtH (ORCPT + 99 others); Thu, 4 Nov 2021 20:49:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229587AbhKEAtG (ORCPT ); Thu, 4 Nov 2021 20:49:06 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB086C061714 for ; Thu, 4 Nov 2021 17:46:27 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id u17so10033415plg.9 for ; Thu, 04 Nov 2021 17:46:27 -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=+MDx1GrQOub7zJ6Bty8NHKGO6IrOVwg4Q81dxTNGuQk=; b=z1/ZhSMbHBPL6xzuOjXk5p5q8nj06Ql+kZbdIIDYl2CXDWH4nHvtvPlsJceWFuEGIF myQd9Ksfn0kR9uPGa8zftxWOEOG59ZNoGv1CtLfKrvIUpSB7vYlJGNyyZekRAnKXBD7N hsybPk2pAfClRxwqPoUjS45Zg5Tq6fAbsnpeF1TjYVSUzg7Sa1GGmQMgocz6Ur7p+kyh NjRzOqs4+/kxpk/kJVoKkUYXZuLzbiNNMBoikc2mVwUAK+rMppBW6zq18u8KusKY6kd/ kZS0fDZuKBAfOGbMeFC9mp4qg0YUwo8+QioiDMxufM4dq7qAm4W3NRici1vzeQprCAsJ OqAg== 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=+MDx1GrQOub7zJ6Bty8NHKGO6IrOVwg4Q81dxTNGuQk=; b=q0mBKqS54NgJUvFE0zxweH77fDRhDFkFFTLsGTLjp7oNoW2EJBdN5DYVNNXjVc/vQH xG5i/GYUdTQ+a+QVoprkCBvCznTjqKVsj77FceI3g7fGLlf77PuGRLaXKxmZCTVBSmgO zr2fGmgMW2A4kZaq9hNGPCnVGd9f1oVD8jUeLqdSY0n7D+ARcuzVOF65rjfIFoBGJye+ qLq6uj9PErzICTTt3BZ7Ufn6+8RiJgFNcxLJXtq6Ft9ArxpFSyuCPXG02/Lincbljnli 7aD1UYc5+A9nepqyO/jxAAj0gd3vBqmfZt6WLaDePAPghy4w73vfCOWaKYdirkfqoggg Frkw== X-Gm-Message-State: AOAM532fNgCZdf7+uvivpQdMhF9L0uyUhI+PRY0aigb9s9X2dJgSxj1y b4NJaMvkQvQ+/RdmsP8LXRBv9JrLZqEN0cM3vLsb1Q== X-Received: by 2002:a17:902:b697:b0:141:c7aa:e10f with SMTP id c23-20020a170902b69700b00141c7aae10fmr35263948pls.18.1636073186843; Thu, 04 Nov 2021 17:46:26 -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: <342eb71c-0aff-77e5-3c71-92224d7d48e0@oracle.com> From: Dan Williams Date: Thu, 4 Nov 2021 17:46:17 -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 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.