Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp76625ybe; Wed, 4 Sep 2019 15:27:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwtLQ0q8toZYZEEr6zIypDxniV04fk42DXJi7x2rX/s5iGilW29y71Wsfzvn02C7zrDD8i2 X-Received: by 2002:a17:90a:e38b:: with SMTP id b11mr548869pjz.142.1567636033710; Wed, 04 Sep 2019 15:27:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567636033; cv=none; d=google.com; s=arc-20160816; b=cEAo7+y00fHDpcibskQJtISApobTptGM4mAZaFnw95cZDBacYxR7PdUrM+XXuR+0KB joZQyuvY8r8xhfTsVeADwt3m4IWLQVgY5RCQP7u2gVwGO4c6QL9R2rkkhCy0hsP/8PuF K4sBworvP7EThNX1rFbZb2ch3zgsyIlfr9LpUOFEgcDcgia4RNn5EabgPY6Izafh+XPG FnrdOm1srE7DygzqebToPy9Sp3I+Ksfwl7Zzl26odYBMEECwa3kPAYcDZJXln9FIBx9V OZILrk0BvjitTigqSOCEOcnKbjAJugtAHuA8T/zlPmtH9aCg+k+ZbjS/RgxdXgDBo4me /k9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=wuXAkqtLnLKNeMuPNQdvQtybeDuu84OBitdIarPC/6Q=; b=whoyK0Pfx5muwvjqkINwXHZlV4KdYWSaXj7nu07Msu1VRiVJkJzj8Uyzg0MNm59RIE c03mcVpltDxenRTvEUIp8/uStbx5Zcwqwl2BR5w+DLxKWv+J7gloA/EyV10JslMsP6TU XjCE4xvEDWB/+oDTFCsZx9J9EEmln/zQAgHK6TyBUiRHFHKsIJCgX/LsM1dKqHgs3zIN Y/rb6K3TDzRJzLaZOfj7CfHX7PL39VF55k19kkIKtBRp3G9Y17aXsLAJtjcFePEkVEsV 9KjbJbrpgGH3Dmu+7vBFb290dbXlDmCTaBHQogKpnO7HiEjn7LsHvsA9lq0WVGeUIV4i WSRg== ARC-Authentication-Results: i=1; mx.google.com; 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 d24si190231pll.77.2019.09.04.15.26.49; Wed, 04 Sep 2019 15:27:13 -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; 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 S1730447AbfIDWZw (ORCPT + 99 others); Wed, 4 Sep 2019 18:25:52 -0400 Received: from mga05.intel.com ([192.55.52.43]:12586 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725965AbfIDWZw (ORCPT ); Wed, 4 Sep 2019 18:25:52 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2019 15:25:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,468,1559545200"; d="scan'208";a="185252801" Received: from iweiny-desk2.sc.intel.com ([10.3.52.157]) by orsmga003.jf.intel.com with ESMTP; 04 Sep 2019 15:25:50 -0700 Date: Wed, 4 Sep 2019 15:25:50 -0700 From: Ira Weiny To: Jason Gunthorpe Cc: Andrew Morton , Dan Williams , Matthew Wilcox , Jan Kara , Theodore Ts'o , John Hubbard , Michal Hocko , Dave Chinner , linux-xfs@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-nvdimm@lists.01.org, linux-ext4@vger.kernel.org, linux-mm@kvack.org Subject: Re: [RFC PATCH v2 16/19] RDMA/uverbs: Add back pointer to system file object Message-ID: <20190904222549.GC31319@iweiny-DESK2.sc.intel.com> References: <20190809225833.6657-17-ira.weiny@intel.com> <20190812130039.GD24457@ziepe.ca> <20190812172826.GA19746@iweiny-DESK2.sc.intel.com> <20190812175615.GI24457@ziepe.ca> <20190812211537.GE20634@iweiny-DESK2.sc.intel.com> <20190813114842.GB29508@ziepe.ca> <20190813174142.GB11882@iweiny-DESK2.sc.intel.com> <20190813180022.GF29508@ziepe.ca> <20190813203858.GA12695@iweiny-DESK2.sc.intel.com> <20190814122308.GB13770@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190814122308.GB13770@ziepe.ca> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Aug 14, 2019 at 09:23:08AM -0300, Jason Gunthorpe wrote: > On Tue, Aug 13, 2019 at 01:38:59PM -0700, Ira Weiny wrote: > > On Tue, Aug 13, 2019 at 03:00:22PM -0300, Jason Gunthorpe wrote: > > > On Tue, Aug 13, 2019 at 10:41:42AM -0700, Ira Weiny wrote: > > > > > > > And I was pretty sure uverbs_destroy_ufile_hw() would take care of (or ensure > > > > that some other thread is) destroying all the MR's we have associated with this > > > > FD. > > > > > > fd's can't be revoked, so destroy_ufile_hw() can't touch them. It > > > deletes any underlying HW resources, but the FD persists. > > > > I misspoke. I should have said associated with this "context". And of course > > uverbs_destroy_ufile_hw() does not touch the FD. What I mean is that the > > struct file which had file_pins hanging off of it would be getting its file > > pins destroyed by uverbs_destroy_ufile_hw(). Therefore we don't need the FD > > after uverbs_destroy_ufile_hw() is done. > > > > But since it does not block it may be that the struct file is gone before the > > MR is actually destroyed. Which means I think the GUP code would blow up in > > that case... :-( > > Oh, yes, that is true, you also can't rely on the struct file living > longer than the HW objects either, that isn't how the lifetime model > works. Reviewing all these old threads... And this made me think. While the HW objects may out live the struct file. They _are_ going away in a finite amount of time right? It is not like they could be held forever right? Ira > > If GUP consumes the struct file it must allow the struct file to be > deleted before the GUP pin is released. > > > The drivers could provide some generic object (in RDMA this could be the > > uverbs_attr_bundle) which represents their "context". > > For RDMA the obvious context is the struct ib_mr * > > > But for the procfs interface, that context then needs to be associated with any > > file which points to it... For RDMA, or any other "FD based pin mechanism", it > > would be up to the driver to "install" a procfs handler into any struct file > > which _may_ point to this context. (before _or_ after memory pins). > > Is this all just for debugging? Seems like a lot of complication just > to print a string > > Generally, I think you'd be better to associate things with the > mm_struct not some struct file... The whole design is simpler as GUP > already has the mm_struct. > > Jason