Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5982626ybi; Wed, 12 Jun 2019 11:50:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxT+A/JXFGNtCIJY9MjPeDJAXDnMBTehcFrYBoy4alO75MsMrAuG7aOrwDJDMTfoZ4Ur0LB X-Received: by 2002:a63:5656:: with SMTP id g22mr11320965pgm.280.1560365419519; Wed, 12 Jun 2019 11:50:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560365419; cv=none; d=google.com; s=arc-20160816; b=QMmwc81pOUwyA8++7jy0cPj9q8X5+xhuhwhRMGWOm57jivnDKmFYb1fI7HSECHvZIM jPcna2f2UqmkP3dMeoJ3DbG42A2etS/kykEEJMcdScfpzHKvYTDG2X6UQC5RqiotvYHf spUVf+bmW4WJQJRyon6Eh1QhTrbU1bUly0Pe5Fv9as0qVkA1bg3I68sPXgpkdCRZt8G3 dIInQsgkajNTLSQQEPYo+ucZe6SK1YCxoBezJXyeNBDU6Va12rTm1zso5/aWdBNWoYgX VJ9BrlOzvcl2xaeh/P3LG5xmawZFjGnedGK7yZ5+QmQ1iSiRahkN0dojqQMoOvkzb8dz chuA== 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=oLKBk3Q7ccO0NJJMRJYYFBU09UJHS0/ornRP0j3Fxnk=; b=Q+uq794Wzuk909Ku5dDMFTw/FYjO7e86XkPIrwwu7jE64NW1WJtEylX2HT97DKT5bG 3+ZUQno45oV892fLIucI93fGS6yyyYnzgpqdfF+zeIGaYh1UR+1vMRYRGU0XrgZ9XUet 4u25ZxU5yxeDABJ5XTPKOciPRJGAIHd69MtypHggpGg+jTe+0pru4N/L8Lnl/eEIgLdP 2f1ZT8vNorByEKTAcYqER08KaR31jyjG7H5pqOBqMLpFyaUOM84Dc2itrUXMy1aBzFnD IoEYabF6d3fRBwGbVjgoUI6voHBmjv1ZREVuCea2Hb+1EHnHKR9oQ9XzNDwUf9YIZWds 5suA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=gmeYon7z; 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 a6si380720pla.259.2019.06.12.11.50.05; Wed, 12 Jun 2019 11:50:19 -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=gmeYon7z; 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 S1725497AbfFLSuD (ORCPT + 99 others); Wed, 12 Jun 2019 14:50:03 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:43028 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726830AbfFLSuD (ORCPT ); Wed, 12 Jun 2019 14:50:03 -0400 Received: by mail-oi1-f193.google.com with SMTP id w79so12470587oif.10 for ; Wed, 12 Jun 2019 11:50:03 -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=oLKBk3Q7ccO0NJJMRJYYFBU09UJHS0/ornRP0j3Fxnk=; b=gmeYon7zauy3OQh0dds8NZYm6t5UDisLz6yhyFv+zAHzAQld3I1PlASf7zsZM+CaaZ CehQMBgQdj6gortTquDOB3N7bsSZoRiiIPq0F65TSYhGSEiVglTlgXcZdamdruNK0EZE L4hW+NB6I/OXN8FIUSFL51bNjJWJFW8hzlwgXFjesNuMtfLc6oA7+M/3K2vidJa0br9V czG4Eoe/orE9D++K3+lLCE4n/UgTBq+X11qW/QB7IGhWEAbaQV6NagrYsJ8UOQey3FsU R4uBxwDIf6zhdzoruyQQmgKdtCNWOHRzy7IMkgSp8cIYB925DCaZB8zX5lMCi8WnCkui Earw== 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=oLKBk3Q7ccO0NJJMRJYYFBU09UJHS0/ornRP0j3Fxnk=; b=GX2g32yQOzkq2BjB/Ib9m+KDPuNDZotJwkWb2xZCypfQ1Xt4NX0Pv7scpyqvr48P/G M0sbmOA3pdqRM2qp+TsvTwkIvMhxCUm4rvQXm1rIZZ3oLCvcjeIwIfTpua8zUbq50If2 WhsQEwibkYZY5SriM6TFuSfCFDV6fYEHTO0yx2jOyUMPhi1iHfwo3g1oiU/MS0IPkcXc 5hrCGeOlZpIRtZTPF3SV7qBSQed9/W05fSFx19eB0ywMXyUxSW3C1TBuCrFtnezF3uo/ x68BFXdT+ROpg0lqb+HtyPU/du2ESsD0XFAG/7GYB48S7MeNYVcVsJk9b8GC/BSUhTbM e6RQ== X-Gm-Message-State: APjAAAV7QROwL+SfMwgAVt6L7H602vkaUIc3RG0Dcd1ttNkYn0UUqLdD 7qW2MHL6I0LiwaxcuJza84W+8wTkZfIEECoOAxMmFQ== X-Received: by 2002:aca:ec82:: with SMTP id k124mr420099oih.73.1560365403007; Wed, 12 Jun 2019 11:50:03 -0700 (PDT) MIME-Version: 1.0 References: <20190606014544.8339-1-ira.weiny@intel.com> <20190606104203.GF7433@quack2.suse.cz> <20190606195114.GA30714@ziepe.ca> <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> In-Reply-To: <20190612102917.GB14578@quack2.suse.cz> From: Dan Williams Date: Wed, 12 Jun 2019 11:49:52 -0700 Message-ID: Subject: Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal To: Jan Kara Cc: Ira Weiny , Jason Gunthorpe , "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 3:29 AM Jan Kara wrote: > > On Fri 07-06-19 07:52:13, Ira Weiny wrote: > > On Fri, Jun 07, 2019 at 09:17:29AM -0300, Jason Gunthorpe wrote: > > > On Fri, Jun 07, 2019 at 12:36:36PM +0200, Jan Kara wrote: > > > > > > > Because the pins would be invisible to sysadmin from that point on. > > > > > > It is not invisible, it just shows up in a rdma specific kernel > > > interface. You have to use rdma netlink to see the kernel object > > > holding this pin. > > > > > > If this visibility is the main sticking point I suggest just enhancing > > > the existing MR reporting to include the file info for current GUP > > > pins and teaching lsof to collect information from there as well so it > > > is easy to use. > > > > > > If the ownership of the lease transfers to the MR, and we report that > > > ownership to userspace in a way lsof can find, then I think all the > > > concerns that have been raised are met, right? > > > > I was contemplating some new lsof feature yesterday. But what I don't > > think we want is sysadmins to have multiple tools for multiple > > subsystems. Or even have to teach lsof something new for every potential > > new subsystem user of GUP pins. > > Agreed. > > > I was thinking more along the lines of reporting files which have GUP > > pins on them directly somewhere (dare I say procfs?) and teaching lsof to > > report that information. That would cover any subsystem which does a > > longterm pin. > > So lsof already parses /proc//maps to learn about files held open by > memory mappings. It could parse some other file as well I guess. The good > thing about that would be that then "longterm pin" structure would just hold > struct file reference. That would avoid any needs of special behavior on > file close (the file reference in the "longterm pin" structure would make > sure struct file and thus the lease stays around, we'd just need to make > explicit lease unlock block until the "longterm pin" structure is freed). > The bad thing is that it requires us to come up with a sane new proc > interface for reporting "longterm pins" and associated struct file. Also we > need to define what this interface shows if the pinned pages are in DRAM > (either page cache or anon) and not on NVDIMM. The anon vs shared detection case is important because a longterm pin might be blocking a memory-hot-unplug operation if it is pinning ZONE_MOVABLE memory, but I don't think we want DRAM vs NVDIMM to be an explicit concern of the interface. For the anon / cached case I expect it might be useful to put that communication under the memory-blocks sysfs interface. I.e. a list of pids that are pinning that memory-block from being hot-unplugged.