Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3116710ybb; Mon, 6 Apr 2020 02:23:42 -0700 (PDT) X-Google-Smtp-Source: APiQypLRwEKW28X+l/kt6rgfBcf72ujv6I7oTtQKSKn/mF8S0SO62jPqWuvx+2iurUZr1jFIBb7W X-Received: by 2002:aca:3ad7:: with SMTP id h206mr11445503oia.169.1586165021911; Mon, 06 Apr 2020 02:23:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586165021; cv=none; d=google.com; s=arc-20160816; b=DWIse6qvm0oTTZEBR9/61d8bz1a/59rkfpr9olCQvpcCN5KQ8FDEcVw+fKZaKsRriR w5n2UbJUPlA/tjcsHEscWXypaB49OZYXv/BCdMDHuySDbh0QFElk0vDrgz2ZcWPvRCZD 8+KswiGmSiTsn/LNPaNgWzqzmIrBfxX4a5PctBYsXqKTDJvc0kWMuW4n7PTZ5XJ8dreR WxmweRgohdJDRQ35AqCWQsdQLTWqKdA+yp3/i4n8d7blcr1QHO7oatXGB7WzyxcmO0yJ /jFFeIyoQ11iSY/CA0x5zeCqje08Yi7KpxQDvEP4h4Ow5BsOddAuP5OskIuCV48k/V63 t2yw== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ICZidZS836uKk3f5MYlrKnxf/d24delcy3nSKE9ogi4=; b=iNQOui4MFTbqHLutebh90Ee6ZwucvbGFhdABS/rN3Fn0V8LAsApXMM23RhUwv7eNNA 0se5RvFfe/oK2bWLHGJdbGUNbP9B5p/O8nicODN5NpeSEvnynAP4ODZG1pelbov7CTpF LPXldL5X+jdypZ+WqG13cv3nTftXygP+iSceKpyJsHtD+N93guWfwMIr+1/XZYe26eHZ xRNJQGsFAneA/n3HWp1uv6xH1ydR0nve88k33eciiNwCfUSxBbkrBHSFdN2wzZt+SY3D jXHzj/6878a594FkYlqG/ZRk9aZxr6rwCgZ2W06AGrWg1YSOPRCzGs8TNJblRWImMs85 X9jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=W3pq5Mo7; 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 i13si8803255otk.236.2020.04.06.02.23.29; Mon, 06 Apr 2020 02:23:41 -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=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=W3pq5Mo7; 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 S1726766AbgDFJWq (ORCPT + 99 others); Mon, 6 Apr 2020 05:22:46 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:43352 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726655AbgDFJWq (ORCPT ); Mon, 6 Apr 2020 05:22:46 -0400 Received: by mail-ed1-f65.google.com with SMTP id bd14so18314625edb.10 for ; Mon, 06 Apr 2020 02:22:43 -0700 (PDT) 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:content-transfer-encoding; bh=ICZidZS836uKk3f5MYlrKnxf/d24delcy3nSKE9ogi4=; b=W3pq5Mo7uZpLVGOq5GAIDI/ai7fUH4IIThQ1nwRczafHnhltyPbRBYi4qNanWLvp69 +904YhfbA4VWq0KvmJHQkjtbf5BXIa7CMoQ1Fr67ulXZcagefy/tt06DHI28sQAl1Z4o hoDv8pLs5dD5DoPrxG3VeoDU6ANvHB8Mx51a0= 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:content-transfer-encoding; bh=ICZidZS836uKk3f5MYlrKnxf/d24delcy3nSKE9ogi4=; b=gSGaQPSSNdtSevL5xfHgg0b7Bx21mx2M4xTZ8ip2LE8M6kqey4JrM3LbLmFgNPnsld GiZHvsvjfFkv3ccOcHIshnu5tamPYB6AlGyuUtd6q0rzpN/XdvpLJVPRTktm2GsKWfWO SImSkOwPRU6HJhz6NmT5rhCln65K7I8L0CN4iP580JlO8oO2Tn0qbjqksPNvsYhAG7QV GlNiaraHu7UdZSlPko9KhkmACVcWDIxtH8p/KAC8rJ5Or+ykJZTr7aSFL31cafMY3nGC Kacn+ajdkc7JWKEMj3jcUnPPc25aPg/W6zV5dhqzkyam5K4ZA/TW5bN0c+9hBU9zlmYn ndlA== X-Gm-Message-State: AGi0PuYHB8wsby69dEPdqhMhc4rtUDBUXt2PvGtbYEnal5Vwb+W7iyul DRO6wyTNl5OlJermrEnafs4mOF00mB1R16L+cNfjDg== X-Received: by 2002:a17:906:b351:: with SMTP id cd17mr20431593ejb.351.1586164962711; Mon, 06 Apr 2020 02:22:42 -0700 (PDT) MIME-Version: 1.0 References: <36e45eae8ad78f7b8889d9d03b8846e78d735d28.camel@themaw.net> <20200402143623.GB31529@gardel-login> <20200402152831.GA31612@gardel-login> <20200402155020.GA31715@gardel-login> <20200403110842.GA34663@gardel-login> <20200403150143.GA34800@gardel-login> In-Reply-To: <20200403150143.GA34800@gardel-login> From: Miklos Szeredi Date: Mon, 6 Apr 2020 11:22:31 +0200 Message-ID: Subject: Re: Upcoming: Notifications, FS notifications and fsinfo() To: Lennart Poettering Cc: Ian Kent , David Howells , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 3, 2020 at 5:01 PM Lennart Poettering wr= ote: > > On Fr, 03.04.20 13:48, Miklos Szeredi (miklos@szeredi.hu) wrote: > > > > > Does that make any sense? > > > > > > When all mounts in the init mount namespace are unmounted and all > > > remaining processes killed we switch root back to the initrd, so that > > > even the root fs can be unmounted, and then we disassemble any backin= g > > > complex storage if there is, i.e. lvm, luks, raid, =E2=80=A6 > > > > I think it could be done the other way round, much simpler: > > > > - switch back to initrd > > - umount root, keeping the tree intact (UMOUNT_DETACHED) > > - kill all remaining processes, wait for all to exit > > Nah. What I wrote above is drastically simplified. It's IRL more > complex. Specific services need to be killed between certain mounts > are unmounted, since they are a backend for another mount. NFS, or > FUSE or stuff like that usually has some processes backing them > around, and we need to stop the mounts they provide before these > services, and then the mounts these services reside on after that, and > so on. It's a complex dependency tree of stuff that needs to be done > in order, so that we can deal with arbitrarily nested mounts, storage > subsystems, and backing services. That still doesn't explain why you need to keep track of all mounts in the system. If you are aware of the dependency, then you need to keep track of that particular mount. If not, then why? What I'm starting to see is that there's a fundamental conflict between how systemd people want to deal with new mounts and how some other people want to use mounts (i.e. tens of thousands of mounts in an automount map). I'm really curious how much the mount notification ring + per mount query (any implementation) can help that use case. > Anyway, this all works fine in systemd, the dependency logic is > there. We want a more efficient way to watch mounts, that's > all. Subscribing and constantly reparsing /proc/self/mountinfo is > awful, that's all. I'm not sure that is all. To handle storms of tens of thousands of mounts, my guess is that the fundamental way of dealing with these changes will need to be updated in systemd. Thanks, Miklos