Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5399834pxb; Mon, 7 Feb 2022 00:48:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJzurpxCmmhkhl5fqBEhthyklF/2t7K6ktToe3g6AHlV0x0KiMbRYs2OMkTpn2d0z/6UVGXU X-Received: by 2002:a05:6402:125a:: with SMTP id l26mr12774231edw.455.1644223696375; Mon, 07 Feb 2022 00:48:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644223696; cv=none; d=google.com; s=arc-20160816; b=KpZ+7ilTOAv7QYAB578c3Q6tcBgHDb5RgS/ihrjJFtHpLVCJ8+JHlYxhYYADzhjNoj 5sLl3FiqENtcXiy7ZjC+HWoPF8ic3dgR7i64+jqq8NWp0f1HZrL8r5qO1XoHNpuILE17 tMu57GHdDHlwf/7oUMxnWQjAcDNq0WMfd9n+qARcxryG758gpVl64H4CCvKmpLTb2VkH QHtS2oSNxJrUnvOAV4pUij3hSyso8gJ/V7y+Hrnmq2olSSYCJ9ZGjEuNImT8mPEcosnX ne+r4UXxToqUGSGp7ATiMTS/6jJwkWc0zgm/KyPLOSaXrYi2cloyFfrb1gVAoCm4Q1Qs Ofmw== 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=vN8r1693du3PiFHORoF+6XkBaejut5sZwHBBBXAp4b4=; b=CY2n1TismTKy8Tg4mcX4411p+4rvoTJFihfpaFdpjKFf1UWFQF0WWtjq+FaCJLs4nM O3cf+sSF09gH8mgCUCod5B4dMqtoy1Kqo7SbFHWM+qAvItFtjG7sYdayMHg09nsfAJh9 DRcTzJUQ4b0K6a01FVwK7S1tsl7jP7+PEteuy21G6EeATcxQTX1ffQ10bke7I87BbYJW 2GHQS1+GcaglT6p3zSoIZoN274AJY5PW4RGU6TakJV4ZtlskoHLwXQ7TQZW37+JVTEYT CDA2rA3siO2Bm2QW+pv79+BBm4f4OE5+kcuC5rN7cW4mAojiI8R4+rU7FN5qvIDKekk8 xntw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20210112.gappssmtp.com header.s=20210112 header.b=r5xBUQSB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 13si6439231ejh.92.2022.02.07.00.47.51; Mon, 07 Feb 2022 00:48:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20210112.gappssmtp.com header.s=20210112 header.b=r5xBUQSB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S237178AbiBDFcn (ORCPT + 99 others); Fri, 4 Feb 2022 00:32:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242596AbiBDFck (ORCPT ); Fri, 4 Feb 2022 00:32:40 -0500 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59F8AC061714 for ; Thu, 3 Feb 2022 21:32:40 -0800 (PST) Received: by mail-pl1-x62a.google.com with SMTP id l13so4212258plg.9 for ; Thu, 03 Feb 2022 21:32:40 -0800 (PST) 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=vN8r1693du3PiFHORoF+6XkBaejut5sZwHBBBXAp4b4=; b=r5xBUQSBVK4ISHFSXxzu36dJntJrOd3LEYFsnEK/7xZA3g9zfHRU7BCTHBvx1bjTgO cfp/4StkgZzEWMH6+H8zE1/o9Prx5Tbajr7iBCm4uZRiYa3RHoqmZrFirUpqfyqklAwG /WgF/lds8HCPd96gV717iaR4n533kYGw/+0VwqJVTLNYO/lF3PvM5HRSY9GO4WL5kn3D gtofsBL9LRNlbft6Ok6aTyZFUmPKXHfZpL30NqpI5N042jUlMpk1MW1bbD+3KYQQp/o+ Pb6K9hZGVgjc0zUK+yz3azRQiJHBU2duTLWFfxr7YCDxwtXrcDkUia5Edz1Qeeur7fH0 1WfQ== 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=vN8r1693du3PiFHORoF+6XkBaejut5sZwHBBBXAp4b4=; b=ue54M/9qHMj3M2tCX7Jlkr3Y1zlDVCXSYd8w39J12zgnWxnHnhSqZbQS4YqkQL2aVa 9Dmzs8jXSBh9HkVVYE779D9tB8qXAw9evk6iBBN0bZ7YkvuCjQlV+2fORMPvTB1P7qXg wZMBuwyLIbqFSrCY6naG2ON7R0oMeRKoHCW368vDer4AMKCTSxF8UwEKS+hOZXsEkcf7 ZxkLQUdyGPdKz3XkJq7TZdZ99gN21i5XOGZ1dU4VrdBHCkwBCTt+or9De3jmH5ZjNQQW YItmH6qas5DJwwk+dgYJyE+RD1wKLhSKrMBAg4ZAigONOwIuMXWrkUNb7lmzf71KKdaC e4Jg== X-Gm-Message-State: AOAM531lz2FBjL1gS7iW0izSHeUTRsAF8wAY1k5jQr85o7wr1Myyg+Jy vWyx89CCuJuxR9Xt+0mU3n7FyZuZA1NCqd4/jI/yqA== X-Received: by 2002:a17:90b:3ece:: with SMTP id rm14mr1346519pjb.220.1643952759933; Thu, 03 Feb 2022 21:32:39 -0800 (PST) MIME-Version: 1.0 References: <20220128213150.1333552-1-jane.chu@oracle.com> <20220128213150.1333552-3-jane.chu@oracle.com> <45b4a944-1fb1-73e2-b1f8-213e60e27a72@oracle.com> In-Reply-To: From: Dan Williams Date: Thu, 3 Feb 2022 21:32:27 -0800 Message-ID: Subject: Re: [PATCH v5 2/7] dax: introduce dax device flag DAXDEV_RECOVERY To: Christoph Hellwig Cc: Jane Chu , "david@fromorbit.com" , "djwong@kernel.org" , "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, Feb 3, 2022 at 9:17 PM Dan Williams wrote: > > On Thu, Feb 3, 2022 at 5:43 AM Christoph Hellwig wrote: > > > > On Wed, Feb 02, 2022 at 09:27:42PM +0000, Jane Chu wrote: > > > Yeah, I see. Would you suggest a way to pass the indication from > > > dax_iomap_iter to dax_direct_access that the caller intends the > > > callee to ignore poison in the range because the caller intends > > > to do recovery_write? We tried adding a flag to dax_direct_access, and > > > that wasn't liked if I recall. > > > > To me a flag seems cleaner than this magic, but let's wait for Dan to > > chime in. > > So back in November I suggested modifying the kaddr, mainly to avoid > touching all the dax_direct_access() call sites [1]. However, now > seeing the code and Chrisoph's comment I think this either wants type > safety (e.g. 'dax_addr_t *'), or just add a new flag. Given both of > those options involve touching all dax_direct_access() call sites and > a @flags operation is more extensible if any other scenarios arrive > lets go ahead and plumb a flag and skip the magic. Just to be clear we are talking about a flow like: flags = 0; rc = dax_direct_access(..., &kaddr, flags, ...); if (unlikely(rc)) { flags |= DAX_RECOVERY; dax_direct_access(..., &kaddr, flags, ...); return dax_recovery_{read,write}(..., kaddr, ...); } return copy_{mc_to_iter,from_iter_flushcache}(...);