Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7122162ybi; Thu, 13 Jun 2019 09:57:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqwl27rPbfS2GpfsICEownrPrnseBPkX3dS3xr6i8kHzH86J4LJi1l5CGMT3BlxqtvICr/pg X-Received: by 2002:a63:2b90:: with SMTP id r138mr1171505pgr.418.1560445047188; Thu, 13 Jun 2019 09:57:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560445047; cv=none; d=google.com; s=arc-20160816; b=tgJTaUsQDphxtKWoi3wU5MZervklFQW1fHIMTWNAlW1JqXMAhhSrv8O9mW6TmJEexu Vhshdly0u0sz/YNxjXpVDNHfcvEdjXgrEf+VmZ6ZOC8cEtv2B3rbZIx8WznNn3hHSbA3 UBpO6dAxiJD2tTgfCUZV7zwBEV43HqcZh96jQMScQbGLjuYO3W+R9PFm4rIZPA3u2LUW P0f8Mg5ocsGE5I841E5N/z1NlcSrJZczrUrByc3hseDkHX5sOqj51EQOf/+UmQXC8hQs Uu6MnBZ+GWcjDMoBwG3vI7iOl9Allwm7kak9ztLjovj7VNEk54qKx1gjeV9O97guQ9dT POVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=RcKUTNC1/Yaa+Z7YVTaDTsC+idf0Auxj860bjLfby9Y=; b=j8cBf7ncIZrSTgMLxbTyJNQeJlKyvalJUo5O+tGld+oxDxI/v51Wjr9k6EkV7Ip8WS dmQ9nHUxG6/3yvVVsOds94bgyCN+6EpXc7OLtWKFmsg0LcNJWU4qN9DVpTi4A30AuNjP k5foCsss1wSvvbQzp7ck7+lW/JUSn5WiPGi0f38BwczBE4IoTUoz2Y5PmdqSfFROdF6B Lf/kipTkkKuySqBvrsF+pYYUvnVY29MBZwj0mVHGp3MNfBcySyItXOR6XyAjtg33mAVL M9n958xtiM+01pmQn6RPV2dQym9UXy6zxagWJWXR2rA7JWxO+Nuq+se5W6XVIn5PTpjE +G5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=pyVy5aBf; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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. [209.132.180.67]) by mx.google.com with ESMTP id s3si172597pji.94.2019.06.13.09.57.13; Thu, 13 Jun 2019 09:57:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-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=pyVy5aBf; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 S1730051AbfFMQ5K (ORCPT + 99 others); Thu, 13 Jun 2019 12:57:10 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:37651 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729944AbfFMBO6 (ORCPT ); Wed, 12 Jun 2019 21:14:58 -0400 Received: by mail-oi1-f195.google.com with SMTP id t76so13161705oih.4 for ; Wed, 12 Jun 2019 18:14:57 -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=RcKUTNC1/Yaa+Z7YVTaDTsC+idf0Auxj860bjLfby9Y=; b=pyVy5aBfnvmLd4LmS99NC7v2hHH+z4UZs9t88ZWrifMnyNQ1ntVXoql6oB68VhzVo1 F8hclQ0Wyg9MsOlwr7j9F9a5FwakzRc0cX63T9oeseLCkWGBIj3OBaI1LL2HQs2XiGNX ETH5Cv/Dp91sVJ4t+YsWm75tFBfI5P44fYs8oiCUlHe8OHYW0zmCh+Jz3mI3juP3eG0d bwg8PkQXV/rh9Ruhio4gTK3UfuitZunT8jlU1uJv5ynSJJDHBTJWHqmmDp1yyxN5HdDN 3nC3in/UilzgUI6FwH3DI0lKZs/DXkSb6pM0DXEBpGmyHzzfZCjAONw9LI5SpclpGpd3 Jyhw== 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=RcKUTNC1/Yaa+Z7YVTaDTsC+idf0Auxj860bjLfby9Y=; b=eEubA4VBvupIHhvAI3MhztBZLXbJ8ifL6Dz60rHWWDtNCBFaq6KK8Cf+yX/ugwVsrJ VYoEDbQX6JPTYoOd+vd5Rp01v/6UA2Wj1UFp6RrgLjxofwKQ5UKx1MdCoYIMio7/q/Va +MA8rGj94D9kWKdangvXCEbmtBZ76k7enxVoBAuJrkBjlb66Hk6tJGhunKkR7LWjRF97 /gMVZRsFQwoDlxCOruRrZg3kWsy5lqhztrbDJmr9S54i6FgH++91BCERWurNAzsWEGLa rRSgTwQOEPH2iOySIliX8hhVHz3uAO1D/bsTZd2MDqBJNKIAfsopSwitbwLGgb8RpU5a gg7w== X-Gm-Message-State: APjAAAWsxSDzyaE0mO53b81hz6A3aQh8p+fD3rXn1l6njrJphD+sCDKg RcCxrr2V9B1HB03ioeBovrSZ1xtYDLp/muPbz7i6Hg== X-Received: by 2002:aca:fc50:: with SMTP id a77mr1431023oii.0.1560388497122; Wed, 12 Jun 2019 18:14:57 -0700 (PDT) MIME-Version: 1.0 References: <20190606222228.GB11698@iweiny-DESK2.sc.intel.com> <20190607103636.GA12765@quack2.suse.cz> <20190607121729.GA14802@ziepe.ca> <20190607145213.GB14559@iweiny-DESK2.sc.intel.com> <20190612102917.GB14578@quack2.suse.cz> <20190612114721.GB3876@ziepe.ca> <20190612120907.GC14578@quack2.suse.cz> <20190612191421.GM3876@ziepe.ca> <20190612221336.GA27080@iweiny-DESK2.sc.intel.com> <20190612233324.GE14336@iweiny-DESK2.sc.intel.com> In-Reply-To: <20190612233324.GE14336@iweiny-DESK2.sc.intel.com> From: Dan Williams Date: Wed, 12 Jun 2019 18:14:46 -0700 Message-ID: Subject: Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal To: Ira Weiny Cc: Jason Gunthorpe , Jan Kara , "Theodore Ts'o" , Jeff Layton , Dave Chinner , Matthew Wilcox , linux-xfs , Andrew Morton , John Hubbard , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , linux-fsdevel , Linux Kernel Mailing List , linux-nvdimm , linux-ext4 , Linux MM Content-Type: text/plain; charset="UTF-8" Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Jun 12, 2019 at 4:32 PM Ira Weiny wrote: > > On Wed, Jun 12, 2019 at 03:54:19PM -0700, Dan Williams wrote: > > On Wed, Jun 12, 2019 at 3:12 PM Ira Weiny wrote: > > > > > > On Wed, Jun 12, 2019 at 04:14:21PM -0300, Jason Gunthorpe wrote: > > > > On Wed, Jun 12, 2019 at 02:09:07PM +0200, Jan Kara wrote: > > > > > On Wed 12-06-19 08:47:21, Jason Gunthorpe wrote: > > > > > > On Wed, Jun 12, 2019 at 12:29:17PM +0200, Jan Kara wrote: > > > > > > > > > > > > > > > The main objection to the current ODP & DAX solution is that very > > > > > > > > > little HW can actually implement it, having the alternative still > > > > > > > > > require HW support doesn't seem like progress. > > > > > > > > > > > > > > > > > > I think we will eventually start seein some HW be able to do this > > > > > > > > > invalidation, but it won't be universal, and I'd rather leave it > > > > > > > > > optional, for recovery from truely catastrophic errors (ie my DAX is > > > > > > > > > on fire, I need to unplug it). > > > > > > > > > > > > > > > > Agreed. I think software wise there is not much some of the devices can do > > > > > > > > with such an "invalidate". > > > > > > > > > > > > > > So out of curiosity: What does RDMA driver do when userspace just closes > > > > > > > the file pointing to RDMA object? It has to handle that somehow by aborting > > > > > > > everything that's going on... And I wanted similar behavior here. > > > > > > > > > > > > It aborts *everything* connected to that file descriptor. Destroying > > > > > > everything avoids creating inconsistencies that destroying a subset > > > > > > would create. > > > > > > > > > > > > What has been talked about for lease break is not destroying anything > > > > > > but very selectively saying that one memory region linked to the GUP > > > > > > is no longer functional. > > > > > > > > > > OK, so what I had in mind was that if RDMA app doesn't play by the rules > > > > > and closes the file with existing pins (and thus layout lease) we would > > > > > force it to abort everything. Yes, it is disruptive but then the app didn't > > > > > obey the rule that it has to maintain file lease while holding pins. Thus > > > > > such situation should never happen unless the app is malicious / buggy. > > > > > > > > We do have the infrastructure to completely revoke the entire > > > > *content* of a FD (this is called device disassociate). It is > > > > basically close without the app doing close. But again it only works > > > > with some drivers. However, this is more likely something a driver > > > > could support without a HW change though. > > > > > > > > It is quite destructive as it forcibly kills everything RDMA related > > > > the process(es) are doing, but it is less violent than SIGKILL, and > > > > there is perhaps a way for the app to recover from this, if it is > > > > coded for it. > > > > > > I don't think many are... I think most would effectively be "killed" if this > > > happened to them. > > > > > > > > > > > My preference would be to avoid this scenario, but if it is really > > > > necessary, we could probably build it with some work. > > > > > > > > The only case we use it today is forced HW hot unplug, so it is rarely > > > > used and only for an 'emergency' like use case. > > > > > > I'd really like to avoid this as well. I think it will be very confusing for > > > RDMA apps to have their context suddenly be invalid. I think if we have a way > > > for admins to ID who is pinning a file the admin can take more appropriate > > > action on those processes. Up to and including killing the process. > > > > Can RDMA context invalidation, "device disassociate", be inflicted on > > a process from the outside? Identifying the pid of a pin holder only > > leaves SIGKILL of the entire process as the remediation for revoking a > > pin, and I assume admins would use the finer grained invalidation > > where it was available. > > No not in the way you are describing it. As Jason said you can hotplug the > device which is "from the outside" but this would affect all users of that > device. > > Effectively, we would need a way for an admin to close a specific file > descriptor (or set of fds) which point to that file. AFAIK there is no way to > do that at all, is there? Even if there were that gets back to my other question, does RDMA teardown happen at close(fd), or at final fput() of the 'struct file'? I.e. does it also need munmap() to get the vma to drop its reference? Perhaps a pointer to the relevant code would help me wrap my head around this mechanism.