Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2344588ybb; Thu, 2 Apr 2020 18:51:59 -0700 (PDT) X-Google-Smtp-Source: APiQypKv0ilGfjNztDPRQm1CRdgs8QpZXmRsQnLNa7ofAnLk0mAEibVXeZT2/v+zc1Ix3V5jxMBv X-Received: by 2002:a9d:5c82:: with SMTP id a2mr4894659oti.22.1585878718856; Thu, 02 Apr 2020 18:51:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585878718; cv=none; d=google.com; s=arc-20160816; b=Qzxd8h47b2MmoqZ/s7bmTmYiorne3lwyCg7mORdFvZRZd2nc9z+ZukHjnP3HT55UjY CZ4K34TA8FaDhK/cZMbNYNv+ZYPlgcNfTghoR9Lvv5cB74j6ZIaD2ARzkbmY8pBEgVCD 11r0ex2b7+yTQjg74SV4V1UJ0qXWYkuYHMm0QijxylBhgpaV7HIAVR1UQ1cU6O/IYIrN GutIPGByzX2HYhyMaP87/Uezt42BPEV4aTRKk48lSuowoDtJ8zylc0Nm/yPXsvhO27/f TyMHHBTIhCzwoWiGkxWdsI0N6fhmmClJ2QQ+07Iy7hyJDuGAoFqDRFQsN8dZ57xUFxFW mC7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature:dkim-signature; bh=KyvhXjB5DdFettsz9BCOqHLXK5wPN6w15uaxcR0jueY=; b=qc2PRP+gVGMwjxwcQ3r/0Fn4W/kTtmXuUXpEI1egvT+S33/dTdhpO7xhGu1esv3Pfw 3LHeQz0fHgYHtWYiRTDF3iMbjK6JPWM+jPzoc6KZP2+RdARR0Ib+RrZKFDkt/id3YaYw 3Bsf9UTFm1c6z9FNStFKgGckbp4XKrSEEk5OmwZ4K2dRfsjCfCeU1ggnpl1i6qpPVefF ixBNy8S+Ta6ew/cbNlJ+SzXxtvh5AxYdCY74fQSpIb23UmNpvaXb/VdnhyBrDdnPhrG+ 2TN022j2M5O945AVHDJlzdiPA13B/bNBGCDdQiUVeKiEtUVftSDXQzpoaXRzMQI3HQHL GXJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@themaw.net header.s=fm2 header.b=WiorhD9n; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=O854i+9y; 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 b19si3844923ots.224.2020.04.02.18.51.46; Thu, 02 Apr 2020 18:51:58 -0700 (PDT) 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=@themaw.net header.s=fm2 header.b=WiorhD9n; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=O854i+9y; 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 S2390289AbgDCBoO (ORCPT + 99 others); Thu, 2 Apr 2020 21:44:14 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:51669 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389108AbgDCBoO (ORCPT ); Thu, 2 Apr 2020 21:44:14 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id DFB5958024C; Thu, 2 Apr 2020 21:44:11 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 02 Apr 2020 21:44:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=themaw.net; h= message-id:subject:from:to:cc:date:in-reply-to:references :content-type:mime-version:content-transfer-encoding; s=fm2; bh= KyvhXjB5DdFettsz9BCOqHLXK5wPN6w15uaxcR0jueY=; b=WiorhD9nz+ySgT04 SlNTC1Oo8MVXYRcS83g1m8PfBwjQq0WtZOY+ve90s7jrQhNHK/rGJcMtj3Fj/4oM mB+lQ7RNXJnKaR7B5EIK/QThJCwpB/wNxenqGKo9EU7b2IhziOM2RwONboe8FpaM 6HcnaBkeXuqMJVEoTjuXRG3JS/a7nDrufJPK+eyf/g5SkCFn391tmJU7OkikIWhE rIjfzU/o6DkRzw2Db0lqyZe0vOUCuS+WieH7WE0ttAlkc27Wok7tFbGWQ/ItG4ZS vzdhK6Ea6r+RIlQOrxYxDZl8du4CLT/Mqy5ZHll7p+xydP6kThbZbDMEU/jDHbRM wSVI7w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=KyvhXjB5DdFettsz9BCOqHLXK5wPN6w15uaxcR0ju eY=; b=O854i+9yi0NoUPthyXezXO261AjR/d6v7HnPjiHRJdw/Jx3AA84b6upw0 RFM86AqDYX+XAivrs4F1Jftl4CBoF152UfNZC2y95Sl6p8/RBO0ZTimFPolkgFcg J0mdkKWrgVpT5b6SADDMyxG4cb27h/0EwU24UmQYH4q2kOe+/RJyaHwUR6xmeCej JrzdkdTKV5hbyjX0F5/wyYbgI2cFyoaj/xTS7nQMPjN9UE1P5perydJTl131XXKf qo5j4bRdfK/EAQVaLBVjwMobHqG9+mQaSPXPSv5rnHOss48o/WjuBC4tCQasVPwH FXd87Df2/F++wZnShVZ3eVsHr2zbQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrtdehgdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkuffhvfffjghftgfoggfgsehtjeertdertdejnecuhfhrohhmpefkrghnucfm vghnthcuoehrrghvvghnsehthhgvmhgrfidrnhgvtheqnecukfhppeduudekrddvtdelrd duieeirddvfedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomheprhgrvhgvnhesthhhvghmrgifrdhnvght X-ME-Proxy: Received: from centos8 (unknown [118.209.166.232]) by mail.messagingengine.com (Postfix) with ESMTPA id AA752306CEE4; Thu, 2 Apr 2020 21:44:05 -0400 (EDT) Message-ID: <27994c53034c8f769ea063a54169317c3ee62c04.camel@themaw.net> Subject: Re: Upcoming: Notifications, FS notifications and fsinfo() From: Ian Kent To: Miklos Szeredi Cc: David Howells , Lennart Poettering , Christian Brauner , Linus Torvalds , Al Viro , dray@redhat.com, Karel Zak , Miklos Szeredi , Steven Whitehouse , Jeff Layton , andres@anarazel.de, keyrings@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Aleksa Sarai Date: Fri, 03 Apr 2020 09:44:01 +0800 In-Reply-To: References: <20200330211700.g7evnuvvjenq3fzm@wittgenstein> <1445647.1585576702@warthog.procyon.org.uk> <2418286.1585691572@warthog.procyon.org.uk> <20200401144109.GA29945@gardel-login> <2590640.1585757211@warthog.procyon.org.uk> <36e45eae8ad78f7b8889d9d03b8846e78d735d28.camel@themaw.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-9.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2020-04-02 at 15:52 +0200, Miklos Szeredi wrote: > On Thu, Apr 2, 2020 at 4:52 AM Ian Kent wrote: > > On Wed, 2020-04-01 at 18:40 +0200, Miklos Szeredi wrote: > > > On Wed, Apr 1, 2020 at 6:07 PM David Howells > > > > > > wrote: > > > > Miklos Szeredi wrote: > > > > > > > > > I've still not heard a convincing argument in favor of a > > > > > syscall. > > > > > > > > From your own results, scanning 10000 mounts through mountfs > > > > and > > > > reading just > > > > two values from each is an order of magnitude slower without > > > > the > > > > effect of the > > > > dentry/inode caches. It gets faster on the second run because > > > > the > > > > mountfs > > > > dentries and inodes are cached - but at a cost of >205MiB of > > > > RAM. And it's > > > > *still* slower than fsinfo(). > > > > > > Already told you that we can just delete the dentry on > > > dput_final, so > > > the memory argument is immaterial. > > > > > > And the speed argument also, because there's no use case where > > > that > > > would make a difference. You keep bringing up the notification > > > queue > > > overrun when watching a subtree, but that's going to be painful > > > with > > > fsinfo(2) as well. If that's a relevant use case (not saying > > > it's > > > true), might as well add a /mnt/MNT_ID/subtree_info (trivial > > > again) > > > that contains all information for the subtree. Have fun > > > implementing > > > that with fsinfo(2). > > > > Forgive me for not trawling through your patch to work this out > > but how does a poll on a path get what's needed to get mount info. > > > > Or, more specifically, how does one get what's needed to go > > directly > > to the place to get mount info. when something in the tree under > > the > > polled path changes (mount/umount). IIUC poll alone won't do > > subtree > > change monitoring? > > The mechanisms are basically the same as with fsinfo(2). You can > get > to the mountfs entry through the mount ID or through a proc/fd/ type > symlink. So if you have a path, there are two options: > > - find out the mount ID belonging to that path and go to > /mountfs/$mntid/ > - open the path with fd = open(path, O_PATH) and the go to > /proc/self/fdmount/$fd/ > > Currently the only way to find the mount id from a path is by parsing > /proc/self/fdinfo/$fd. It is trivial, however, to extend statx(2) to > return it directly from a path. Also the mount notification queue > that David implemented contains the mount ID of the changed mount. I'm aware the mount id comes through David's notifications, I was wondering how to get that via your recommendation, thanks. In your scheme it sounds like the mount id doesn't hold the importance it deserves, it's central to the whole idea of getting information about these mounts. But it sounds like you need to open fds to paths you might not know to find it ... Your explanation wasn't clear on how one gets notifications of events within a tree under a mount you've opened an fd on to get events? > > > Don't get me wrong, neither the proc nor the fsinfo implementations > > deal with the notification storms that cause much of the problem we > > see now. > > > > IMHO that's a separate and very difficult problem in itself that > > can't even be considered until getting the information efficiently > > is resolved. > > This mount notification storm issue got me thinking. If I > understand > correctly, systemd wants mount notifications so that it can do the > desktop pop-up thing. Is that correct? > > But that doesn't apply to automounts at all. A new mount performed > by > automount is uninteresting to to desktops, since it's triggered by > crossing the automount point (i.e. a normal path lookup), not an > external event like inserting a usb stick, etc... > > Am I missing something? Yeah, you're not missing anything. Unfortunately, in a recent discussion on the autofs mailing list, an investigation showed that systemd does want/get events for autofs mounts and proceeds to issue around a 100 or so events on the d-bus for every one. > > Maybe the solution is to just allow filtering out such notifications > at the source, so automount triggers don't generate events for > systemd. Except that autofs automounts might be expected to be seen on a desktop, that's not out of the question I guess. Ian