Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3254955ybf; Tue, 3 Mar 2020 02:33:28 -0800 (PST) X-Google-Smtp-Source: ADFU+vsTPgo/oGCQ8uaEJxVG39En4/czXDija+8rfbkH600Owy3XAaCvBVjZcgUgmWbBD2RACSD6 X-Received: by 2002:a9d:3f8:: with SMTP id f111mr656770otf.204.1583231607904; Tue, 03 Mar 2020 02:33:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583231607; cv=none; d=google.com; s=arc-20160816; b=p91m3z3z89g3sH265KoOTho/8NP7zVFyv+rQR2WSSDzipR6W12MV94D/KDjPvYk7mB qKqBA/oII1Xp1sLr7Znd9YAM4EPO3gmpNvIz/05etkJs8pPzZMWgWpCiV9i7D50GdYbT RiKI6E0Pu0QCDqU+C9LbDh3VCpUeZHRuY7ki5r4ae5Mia3E2+bk2ivISuumFSOlzqSce HVWnvk1XM+YUxRxjN6Y2KWsHi1npGtIZU6BjxBjTG1Ox+8EGUUA/W8lv2nvjsckAbyMI j3wI2d2TWeifheBMFihEB+YHQHGfl8lXubCRbgwwNEJuVqj/VnesvtHyD7+9Gueuz6Bc kwQA== 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=4OjMBCp185rGeJiYNbICf2InVl2PDcWD4SEMMWbNn20=; b=IG3ntosJQqiVith6c2RdrxLA9hsi238BVfmMS7H7rHniX/qcm1Y4W3HZjas+QuQy3S xF6nU5AqPdW5x0WUz8MwX3ZJO6weyq2A94S1D7zjshV+9V862rKuurD0Ay3dtKs9sMGn CyIp1WpcpqqU2Q24V6mC51Z/eDNA+I9SYhS8KK9Vpg0aczE+ktuIvAaqsro1J0rn7dVr rNGv/dT8noOvjeOoSPwVEK9IWz268sFg5jq43HQ8Sd55IXSuMI3g0Ce6mybIazJYNo20 7Mi/3TbpPzQXCPDvpg6DA8Qe60tlEyHaO6bXfdmh/xRX4tydIiKxkopfkVFvv713532F DB/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=EgBq0A2u; 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 x72si7299832oia.194.2020.03.03.02.33.16; Tue, 03 Mar 2020 02:33:27 -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=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=EgBq0A2u; 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 S1728634AbgCCKcq (ORCPT + 99 others); Tue, 3 Mar 2020 05:32:46 -0500 Received: from mail-il1-f194.google.com ([209.85.166.194]:36321 "EHLO mail-il1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728692AbgCCKcq (ORCPT ); Tue, 3 Mar 2020 05:32:46 -0500 Received: by mail-il1-f194.google.com with SMTP id b15so2321755iln.3 for ; Tue, 03 Mar 2020 02:32:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4OjMBCp185rGeJiYNbICf2InVl2PDcWD4SEMMWbNn20=; b=EgBq0A2ueanm2MvysZvBDL8USSRx6pTzWx2f04bJ4DFxzma7xFHZNG2+Rg4SZkgd+O K26n1FQBeiKe8uXeeDPX7xyIybxQZzyZVVzfse2xhJ/Cz1Oj1bDVo17iaVLZVj0WRG8s nQx5gnQ9btpq29VS2/nKW+UhtVD3Ik2avMa90= 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=4OjMBCp185rGeJiYNbICf2InVl2PDcWD4SEMMWbNn20=; b=ARfCP3A9y4xVztZwoTg9sAgNl0ppzIqjBg6mPKjCDzKF1IN5H+Ji7GhqaiC+eMQptk pzy9cmu+4DDEGz6Zzyv7JgoGwMvfKGL9FerS/KzDLdqhnkijjJDzJjXeUz3Gnp0DIKLp JMaerlq5tU1UW5qdU9VJXV/eZXndntSNgubimLAgZZE7OjHxCfMhZBr918RSY7w8dwt3 Xy012+r1ouV+rqMHy6Eju3Z1u9zVeMuGuz1o7/kruOJ7ZWkfapa4Zhugodw98HnL73cA FTAzV1I2YT5/EZEFVTWzQPOkGf0Oll0r83/oSz5Oj2RAvqxUTXpi91MjWaZs/E0tQh6l QToQ== X-Gm-Message-State: ANhLgQ0CYvMw+Bn7SlPmOi18YUU97ayKtBgzc/v6YnRmfa+eN2/u+yJF BIOOqFyceVmsNJTzADP7ZgpWxgww+YZC4tUUlqJRpA== X-Received: by 2002:a92:89cb:: with SMTP id w72mr3979428ilk.252.1583231564670; Tue, 03 Mar 2020 02:32:44 -0800 (PST) MIME-Version: 1.0 References: <158230810644.2185128.16726948836367716086.stgit@warthog.procyon.org.uk> <1582316494.3376.45.camel@HansenPartnership.com> <1582556135.3384.4.camel@HansenPartnership.com> <1582644535.3361.8.camel@HansenPartnership.com> <20200228155244.k4h4hz3dqhl7q7ks@wittgenstein> <107666.1582907766@warthog.procyon.org.uk> <0403cda7345e34c800eec8e2870a1917a8c07e5c.camel@themaw.net> <1509948.1583226773@warthog.procyon.org.uk> <06d2dbf0-4580-3812-bb14-34c6aa615747@redhat.com> In-Reply-To: <06d2dbf0-4580-3812-bb14-34c6aa615747@redhat.com> From: Miklos Szeredi Date: Tue, 3 Mar 2020 11:32:33 +0100 Message-ID: Subject: Re: [PATCH 00/17] VFS: Filesystem information and notifications [ver #17] To: Steven Whitehouse Cc: David Howells , Ian Kent , Christian Brauner , James Bottomley , Miklos Szeredi , viro , Christian Brauner , Jann Horn , "Darrick J. Wong" , Linux API , linux-fsdevel , lkml , Greg Kroah-Hartman 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 Tue, Mar 3, 2020 at 11:22 AM Steven Whitehouse wrote: > > Hi, > > On 03/03/2020 09:48, Miklos Szeredi wrote: > > On Tue, Mar 3, 2020 at 10:26 AM Miklos Szeredi wrote: > >> On Tue, Mar 3, 2020 at 10:13 AM David Howells wrote: > >>> Miklos Szeredi wrote: > >>> > >>>> I'm doing a patch. Let's see how it fares in the face of all these > >>>> preconceptions. > >>> Don't forget the efficiency criterion. One reason for going with fsinfo(2) is > >>> that scanning /proc/mounts when there are a lot of mounts in the system is > >>> slow (not to mention the global lock that is held during the read). > > BTW, I do feel that there's room for improvement in userspace code as > > well. Even quite big mount table could be scanned for *changes* very > > efficiently. l.e. cache previous contents of /proc/self/mountinfo and > > compare with new contents, line-by-line. Only need to parse the > > changed/added/removed lines. > > > > Also it would be pretty easy to throttle the number of updates so > > systemd et al. wouldn't hog the system with unnecessary processing. > > > > Thanks, > > Miklos > > > > At least having patches to compare would allow us to look at the > performance here and gain some numbers, which would be helpful to frame > the discussions. However I'm not seeing how it would be easy to throttle > updates... they occur at whatever rate they are generated and this can > be fairly high. Also I'm not sure that I follow how the notifications > and the dumping of the whole table are synchronized in this case, either. What I meant is optimizing current userspace without additional kernel infrastructure. Since currently there's only the monolithic /proc/self/mountinfo, it's reasonable that if the rate of change is very high, then we don't re-read this table on every change, only within a reasonable time limit (e.g. 1s) to provide timely updates. Re-reading the table on every change would (does?) slow down the system so that the actual updates would even be slower, so throttling in this case very much makes sense. Once we have per-mount information from the kernel, throttling updates probably does not make sense. Thanks, Miklos