Received: by 10.223.185.116 with SMTP id b49csp926562wrg; Fri, 23 Feb 2018 08:57:15 -0800 (PST) X-Google-Smtp-Source: AH8x224BZ+K+LXpwB+TUZlcFMxRvKy2i9aTJnWjfiBobyKIqtqhknsny5oEKlRr3LnGxK9RMn3a2 X-Received: by 10.98.112.70 with SMTP id l67mr2395959pfc.196.1519405035615; Fri, 23 Feb 2018 08:57:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519405035; cv=none; d=google.com; s=arc-20160816; b=QcAzZOLpLKD9BpIqTHn02usrzVKVaWPMetY6Pqgv/bnDbUjP88oAsSCcxNgB3h+m+2 NdkVJ/1x/mK60GQuiLXmB05uOku9rDlMP4pU93/5gVwMsx9SP4UNuZEjSa3XH6pzmn8g o40XwfLsEXSeHvxCJlEFJLgTke0G3nA0TaT4642HYIWPch053bMmsgUStz03+YGDy+sw zzf+pylb4IURQOv0y59jbMsZYpBm7VvhmUKq9/GXFhPeJPE32QnY3RYINT+LNhqqkcvE osN9IXx5O6mRGwWB/8A76ydq/tXcJYuiVDuw+codVooss/AXTcPlW0WBo14QdVK2h4wD hlhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=cnurs9Tp0vLSTXJuWmDtGjeYFE+la18anY37FddRLwg=; b=YPCDKgaWTPN5dVIhuniaCEcVYOIPjlxE0316z0ynp0FETQmx0uucj/xU2qISvjjD2K f+0WhW1TX1Eoj2UJ24ur0VTeuTT6FV6x8NK1mmUmav+JAlMYBsNYHK4e6saKUqZnKQKk VaxvEdOttmGmHVdgP8SCMdrLui6GnFzhF6JSEskzJP/O9V4bV3XrdA4dH7z6L9HKIrFc gOJqYbpNk1GavnF4psNcmojvkMTwB6jYHFu7FSTGxdqYmMXj02VlxW47TRiOxGNtGu9w zGxvPpTgZEVaXqn4kbVWec2/5RkyuQWoZRsHIKf6ZnmT/dMvAEqK+HZsRJ+rvmd4Eycn KNYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=ev7Lk693; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t3si1753994pgc.81.2018.02.23.08.57.01; Fri, 23 Feb 2018 08:57:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=ev7Lk693; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751880AbeBWQ4L (ORCPT + 99 others); Fri, 23 Feb 2018 11:56:11 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:45202 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751534AbeBWQ4J (ORCPT ); Fri, 23 Feb 2018 11:56:09 -0500 Received: by mail-lf0-f67.google.com with SMTP id x196so13252602lfd.12 for ; Fri, 23 Feb 2018 08:56:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=cnurs9Tp0vLSTXJuWmDtGjeYFE+la18anY37FddRLwg=; b=ev7Lk693s5is29/LEce7M2g8IVnB4fZjP/jyTfITna9ximaUfrLqC3DDzXZJS9XasM iXGToIFYDp4Rj+/UOL7q5ix3mzTj+wTy0P4x6J+o89yGnG1jby3/UjOo5Ndv+9XLTJQi owAAMzOkj63ccOGvPfH+gBF4exf/9ibiB5PyW8qgTJls+rUL89sm25r8GkPxdjzhajpt 5rz8X8dHoGrvRQFjfnzn5Op6xXX4T+WDGLVPi6LWNDK+Pmy5km/OXnFM8BJELb2OylTK 5RIn/ZunKpHqmz/UZJb+8u4qoIh4TtyhcXI0+2aw7fabppXviuRnPmtgUrhdlxn3RH32 GAYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=cnurs9Tp0vLSTXJuWmDtGjeYFE+la18anY37FddRLwg=; b=Dq7M4KJFD6yr2TJuPS9fIKVpL82jBQPGIsjsSfyd5bnMIG6v2YCJbhq2p2taBZ0HjS QX0XUt1rzpkcVzvE7WEvbpfDKuFdESs0d+WIHSZcNr+CECxbRfZ8y8a2BacR6XbEpBFu UAJmYZvkhj6qtdbKjm1qwaapw6CJixDKhqDSGvNGCbSihclV3wgXFzmTLlRoKpK7LTMW WK3bVfi0RcGGx9/b7lUtrPnujvxucYtRKBWm3Hfi4ZtMLTDwIxRHOSvkuROoF1SmeRWS WsIFDpexTK0UTNqUf1yVDw3kATHP9rteUFEeGggHgsmmjiTWnrZ33yS2lSAvKdfzLsz1 yDNw== X-Gm-Message-State: APf1xPCq1N4CDqAgnkDPuTfnu1k2SWyHi4WjXaRNDwKY+W2AoSCDBt79 cJEPlJfmEWPu3DIq/sXvKCKLq4Ch4+2gIldi6tqzKA== X-Received: by 10.46.83.67 with SMTP id t3mr1762737ljd.63.1519404967532; Fri, 23 Feb 2018 08:56:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.23.204 with HTTP; Fri, 23 Feb 2018 08:56:06 -0800 (PST) In-Reply-To: <20180223085547.3kkbo5lbt3orkqqn@hz-desktop> References: <151937026001.18973.12034171121582300402.stgit@dwillia2-desk3.amr.corp.intel.com> <20180223085547.3kkbo5lbt3orkqqn@hz-desktop> From: Dan Williams Date: Fri, 23 Feb 2018 08:56:06 -0800 Message-ID: Subject: Re: [PATCH v2 0/5] vfio, dax: prevent long term filesystem-dax pins and other fixes To: Dan Williams , linux-nvdimm@lists.01.org, Michal Hocko , Jan Kara , KVM list , Linux Kernel Mailing List , stable , Linux MM , Alex Williamson , Gerd Rausch , Alexander Viro , linux-fsdevel , kbuild test robot , Christoph Hellwig Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 23, 2018 at 12:55 AM, Haozhong Zhang wrote: > On 02/22/18 23:17 -0800, Dan Williams wrote: >> Changes since v1 [1]: >> >> * Fix the detection of device-dax file instances in vma_is_fsdax(). >> (Haozhong, Gerd) >> >> * Fix compile breakage in the FS_DAX=n and DEV_DAX=y case. (0day robot) >> >> [1]: https://lists.01.org/pipermail/linux-nvdimm/2018-February/014046.html >> >> --- >> >> The vfio interface, like RDMA, wants to setup long term (indefinite) >> pins of the pages backing an address range so that a guest or userspace >> driver can perform DMA to the with physical address. Given that this >> pinning may lead to filesystem operations deadlocking in the >> filesystem-dax case, the pinning request needs to be rejected. >> >> The longer term fix for vfio, RDMA, and any other long term pin user, is >> to provide a 'pin with lease' mechanism. Similar to the leases that are >> hold for pNFS RDMA layouts, this userspace lease gives the kernel a way >> to notify userspace that the block layout of the file is changing and >> the kernel is revoking access to pinned pages. >> >> --- >> >> Dan Williams (5): >> dax: fix vma_is_fsdax() helper >> dax: fix dax_mapping() definition in the FS_DAX=n + DEV_DAX=y case >> dax: fix S_DAX definition >> dax: short circuit vma_is_fsdax() in the CONFIG_FS_DAX=n case >> vfio: disable filesystem-dax page pinning >> >> >> drivers/vfio/vfio_iommu_type1.c | 18 +++++++++++++++--- >> include/linux/dax.h | 9 ++++++--- >> include/linux/fs.h | 6 ++++-- >> 3 files changed, 25 insertions(+), 8 deletions(-) > > Tested on QEMU with fs-dax and device-dax as vNVDIMM backends > respectively with vfio passthrough. The fs-dax case fails QEMU as > expected, and the device-dax case works normally now. > > Tested-by: Haozhong Zhang > Thank you!