Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756309AbcJZBol (ORCPT ); Tue, 25 Oct 2016 21:44:41 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:51886 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751788AbcJZBoj (ORCPT ); Tue, 25 Oct 2016 21:44:39 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Andrei Vagin Cc: Andrey Vagin , Alexander Viro , Linux Containers , linux-fsdevel , LKML References: <87wphb4pjn.fsf@x220.int.ebiederm.org> <8737jy3htt.fsf_-_@x220.int.ebiederm.org> <20161018024000.GA4901@outlook.office365.com> <87r37e9mnj.fsf@xmission.com> <877f95ngpr.fsf_-_@xmission.com> <20161020213052.GA25226@outlook.office365.com> <87pomtec6c.fsf@xmission.com> <877f90b27o.fsf_-_@xmission.com> <20161025205846.GA25080@outlook.office365.com> <87mvhs14s7.fsf@xmission.com> <20161025234125.GA20335@outlook.office365.com> Date: Tue, 25 Oct 2016 20:42:24 -0500 In-Reply-To: <20161025234125.GA20335@outlook.office365.com> (Andrei Vagin's message of "Tue, 25 Oct 2016 16:41:26 -0700") Message-ID: <87vawfzy0v.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1bzDGe-00033a-MN;;;mid=<87vawfzy0v.fsf@xmission.com>;;;hst=in02.mta.xmission.com;;;ip=75.170.125.99;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+s2caYf8144dCR42CfMcAeqTxkdrrJHtg= X-SA-Exim-Connect-IP: 75.170.125.99 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.0 TVD_RCVD_IP Message was received from an IP address * 1.5 TR_Symld_Words too many words that have symbols inside * 0.7 XMSubLong Long Subject * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa02 1397; Body=1 Fuz1=1 Fuz2=1] * 0.2 T_XMDrugObfuBody_14 obfuscated drug references X-Spam-DCC: XMission; sa02 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;Andrei Vagin X-Spam-Relay-Country: X-Spam-Timing: total 1233 ms - load_scoreonly_sql: 0.06 (0.0%), signal_user_changed: 3.6 (0.3%), b_tie_ro: 2.5 (0.2%), parse: 1.35 (0.1%), extract_message_metadata: 44 (3.5%), get_uri_detail_list: 4.5 (0.4%), tests_pri_-1000: 15 (1.2%), tests_pri_-950: 2.5 (0.2%), tests_pri_-900: 1.98 (0.2%), tests_pri_-400: 40 (3.2%), check_bayes: 37 (3.0%), b_tokenize: 15 (1.2%), b_tok_get_all: 9 (0.7%), b_comp_prob: 5 (0.4%), b_tok_touch_all: 2.9 (0.2%), b_finish: 1.60 (0.1%), tests_pri_0: 562 (45.6%), check_dkim_signature: 1.36 (0.1%), check_dkim_adsp: 6 (0.5%), tests_pri_500: 556 (45.1%), poll_dns_idle: 542 (44.0%), rewrite_mail: 0.00 (0.0%) Subject: Re: [RFC][PATCH v2] mount: In propagate_umount handle overlapping mount propagation trees X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2702 Lines: 67 Andrei Vagin writes: > On Tue, Oct 25, 2016 at 04:45:44PM -0500, Eric W. Biederman wrote: >> That is certainly interesting. The problem is that the reason we were >> going slow is that there were in fact mounts that had not been traversed >> in the share group. > > You are right. > >> >> And in fact the entire idea of visiting a vfsmount mountpoint pair >> exactly once is wrong in the face of shadow mounts. For a vfsmount >> mountpoint pair that has shadow mounts the number of shadow mounts needs >> to be descreased by one each time the propgation tree is traversed >> during unmount. Which means that as far as I can see we have to kill >> shadow mounts to correctly optimize this code. Once shadow mounts are >> gone I don't know of a case where need your optimization. > > Without shadow mounts, it will be hard to save predictable behaviour > for cases like this: > > $ unshare --propagation private -m sh test.sh > + mount -t tmpfs --make-shared zzzz A > + mkdir A/a > + mount -t tmpfs zzzz A/a > + mount --bind A B > + mount -t tmpfs zzzz B/a > + grep zzzz > + cat /proc/self/mountinfo > 155 123 0:44 / /root/tmp/A rw,relatime shared:70 - tmpfs zzzz rw > 156 155 0:45 / /root/tmp/A/a rw,relatime shared:71 - tmpfs zzzz rw > 157 123 0:44 / /root/tmp/B rw,relatime shared:70 - tmpfs zzzz rw > 158 157 0:46 / /root/tmp/B/a rw,relatime shared:72 - tmpfs zzzz rw > 159 155 0:46 / /root/tmp/A/a rw,relatime shared:72 - tmpfs zzzz rw > + umount B/a > + grep zzzz > + cat /proc/self/mountinfo > 155 123 0:44 / /root/tmp/A rw,relatime shared:70 - tmpfs zzzz rw > 156 155 0:45 / /root/tmp/A/a rw,relatime shared:71 - tmpfs zzzz rw > 157 123 0:44 / /root/tmp/B rw,relatime shared:70 - tmpfs zzzz rw > > X + a - a = X > > Maybe we need to add another ID for propagated mounts and when we > do umount, we will detach only mounts with the same propagation id. > > I support the idea to kill shadow mounts. I guess it will help us to > simplify algorithm of dumping and restoring a mount tree in CRIU. > > Currently it is a big pain for us. Killing shadow mounts is not exactly a done deal as there are some user visible effects. The practical question becomes do we break anything anyone cares about in userspace. Answering those practical questions sucks. I definitely think we should try to kill shadow mounts because they are such a big pain to deal with, and only provide very limited value. So far the only thing I have seem shadow mounts being good for is preserving unmount behavior in cases where what someone has constructed an artificially evil mount tree. I haven't figured out how to see how any of those mount trees are actually useful in real life. Eric