Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1204672ybf; Thu, 27 Feb 2020 06:46:58 -0800 (PST) X-Google-Smtp-Source: APXvYqyFo0yJ2aBwdN9QN8f0Bsq3D7I34EVOYXm4NsxjdhHyxpG5rt+fzHzDghq35KGqUSC8Fvrr X-Received: by 2002:a05:6830:18ce:: with SMTP id v14mr11217ote.36.1582814817879; Thu, 27 Feb 2020 06:46:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582814817; cv=none; d=google.com; s=arc-20160816; b=buXkI9hVZ4btUBxb7t3cvXKX+d7UkVbGudfaAV0a4Jr+1B5Pqoo898A63WDn4YFGX5 k1GCxZ21ZB0lZPKqtXWD0dRRfAFsIngFniUU1CPXqlYObTHfK1y6q0TOCzuo9ZgKpvSG +u8k4XI8pYsoIrHHCcO2N2w5C50dZf2vRao6GuY3wdHSIkPyPlvCJjeqc3C5xsZ0/9j/ IAtWjKrgokHYYoYvvR1Acy9gEKwjM0RB0dNZELsLrglfRhwtpzPnMuQBZnarDOJrC0t5 +qf/vAdqMedbRDENYfmxS1qBUs/epgHnu92peOByDk8gdPvEoY3SnH3lr9NWk857Qpc5 +LFg== 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=o8OnTzg5LRFjVMbn8DLKRBIEARILm6ghNdG6yQfmP38=; b=P6AkIQq14sDAK0CVGddgeNJjjHKOrsSYfRfXES/idueaEA6GmdzRE88vz79FWe1Orj nbXJmIxlVIaoTh9eD4cdCBOHqO46b93CpY4rRHL4MKDzW5jBfWHVei3Ue5iVUvFR8hp5 WRfJ10sCNM84BOT0XQKXCdCOR4ODLVXlryX9+9yFnVaX/E61nyCQ2Zfdt33qGdK33P1R YPwdMIoloxXc1k2EEhRnJuv16uuDJOTY0t7AdWTlYqyuGWMe7zeGmcgK8Sw37kmziRPM xCDBSAbOtDhRcnwfHCgXPqNeY/Br9v5b1exzLaM44V+WpUKT4C58K/SVUCRUXA1VmgTd 0OpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=csZxDWdp; 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 74si1693770otd.45.2020.02.27.06.46.45; Thu, 27 Feb 2020 06:46:57 -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=csZxDWdp; 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 S1731232AbgB0OqA (ORCPT + 99 others); Thu, 27 Feb 2020 09:46:00 -0500 Received: from mail-il1-f193.google.com ([209.85.166.193]:42251 "EHLO mail-il1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730401AbgB0Npj (ORCPT ); Thu, 27 Feb 2020 08:45:39 -0500 Received: by mail-il1-f193.google.com with SMTP id x2so2438240ila.9 for ; Thu, 27 Feb 2020 05:45:39 -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=o8OnTzg5LRFjVMbn8DLKRBIEARILm6ghNdG6yQfmP38=; b=csZxDWdp9Kg2a9YfxdWiQA3V9+CoKoVZc0EZnmskUOShlrcXcpWMgE9o4u6YRiHDII 3lY1aufSeabIIc6erb1oS/km4U0n3lTdwzbGWKhOCS7bpEQ8U3Zh6X5Ldpb/jYnFuL/e x43KESU3syYK2PxnF02uwj9pUFlwx7F4kS80Y= 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=o8OnTzg5LRFjVMbn8DLKRBIEARILm6ghNdG6yQfmP38=; b=XGZWN0atfVoAVeX+tW2Ctb8s+V6Kf1bFjnkjt6RWRu73FcfMKCDV2JCXOBfzJjaOcH ShAk+xBhXzuoZzCDGFn0SYd4EnWyB6xdstl7EOMUDO+FWqXL490J2RAkAl/ZVwph+UTV UVcqq9kc3G63EkbeDiJ2seHgtR57OlXvcwVeCoKI8rD3RMA/PXZIlsdVwdjlbV86wk7E pCHTVkwZX3hN+TUTAS/BnzRRI+nJ0mBDsxzZ7EZtF/LovuADickflBiytBxAW7cn0ZgU FLps8snmuqO/sBgTbKFL7Xv5QKZvrchJjvA5zbiXmrRr7D2l9if0Mp8BFxfd4jy2e1w/ CsZQ== X-Gm-Message-State: APjAAAVrQxfH1wniIxU3B1WbdKtz9foKoJFrtu2sLFHrhL7ChtoKROb3 PhJbp39vO59YXla4No4Nh9kyPuOOMyaRiNAXfDGtWA== X-Received: by 2002:a92:89c2:: with SMTP id w63mr5483209ilk.252.1582811138833; Thu, 27 Feb 2020 05:45:38 -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> <1c8db4e2b707f958316941d8edd2073ee7e7b22c.camel@themaw.net> <3e656465c427487e4ea14151b77d391d52cd6bad.camel@themaw.net> In-Reply-To: <3e656465c427487e4ea14151b77d391d52cd6bad.camel@themaw.net> From: Miklos Szeredi Date: Thu, 27 Feb 2020 14:45:27 +0100 Message-ID: Subject: Re: [PATCH 00/17] VFS: Filesystem information and notifications [ver #17] To: Ian Kent Cc: Miklos Szeredi , James Bottomley , Steven Whitehouse , David Howells , viro , Christian Brauner , Jann Horn , "Darrick J. Wong" , Linux API , linux-fsdevel , lkml , Karel Zak , Lennart Poettering , =?UTF-8?Q?Zbigniew_J=C4=99drzejewski=2DSzmek?= , util-linux@vger.kernel.org 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 Thu, Feb 27, 2020 at 12:34 PM Ian Kent wrote: > > On Thu, 2020-02-27 at 10:36 +0100, Miklos Szeredi wrote: > > On Thu, Feb 27, 2020 at 6:06 AM Ian Kent wrote: > > > > > At the least the question of "do we need a highly efficient way > > > to query the superblock parameters all at once" needs to be > > > extended to include mount table enumeration as well as getting > > > the info. > > > > > > But this is just me thinking about mount table handling and the > > > quite significant problem we now have with user space scanning > > > the proc mount tables to get this information. > > > > Right. > > > > So the problem is that currently autofs needs to rescan the proc > > mount > > table on every change. The solution to that is to > > Actually no, that's not quite the problem I see. > > autofs handles large mount tables fairly well (necessarily) and > in time I plan to remove the need to read the proc tables at all > (that's proven very difficult but I'll get back to that). > > This has to be done to resolve the age old problem of autofs not > being able to handle large direct mount maps. But, because of > the large number of mounts associated with large direct mount > maps, other system processes are badly affected too. > > So the problem I want to see fixed is the effect of very large > mount tables on other user space applications, particularly the > effect when a large number of mounts or umounts are performed. > > Clearly large mount tables not only result from autofs and the > problems caused by them are slightly different to the mount and > umount problem I describe. But they are a problem nevertheless > in the sense that frequent notifications that lead to reading > a large proc mount table has significant overhead that can't be > avoided because the table may have changed since the last time > it was read. > > It's easy to cause several system processes to peg a fair number > of CPU's when a large number of mounts/umounts are being performed, > namely systemd, udisks2 and a some others. Also I've seen couple > of application processes badly affected purely by the presence of > a large number of mounts in the proc tables, that's not quite so > bad though. > > > > > - add a notification mechanism - lookup a mount based on path > > - and a way to selectively query mount/superblock information > based on path ... > > > > right? > > > > For the notification we have uevents in sysfs, which also supplies > > the > > changed parameters. Taking aside namespace issues and addressing > > mounts would this work for autofs? > > The parameters supplied by the notification mechanism are important. > > The place this is needed will be libmount since it catches a broad > number of user space applications, including those I mentioned above > (well at least systemd, I think also udisks2, very probably others). > > So that means mount table info. needs to be maintained, whether that > can be achieved using sysfs I don't know. Creating and maintaining > the sysfs tree would be a big challenge I think. > > But before trying to work out how to use a notification mechanism > just having a way to get the info provided by the proc tables using > a path alone should give initial immediate improvement in libmount. Adding Karel, Lennart, Zbigniew and util-linux@vger... At a quick glance at libmount and systemd code, it appears that just switching out the implementation in libmount will not be enough: systemd is calling functions like mnt_table_parse_*() when it receives a notification that the mount table changed. What is the end purpose of parsing the mount tables? Can systemd guys comment on that? Thanks, Miklos