From: Serge Kosyrev <skosyrev@ptsecurity.com>
To: <linux-kernel@vger.kernel.org>
Subject: Fun with looping binds over proc
Date: Thu, 30 Oct 2014 15:07:37 +0300 [thread overview]
Message-ID: <87vbn1222e.fsf@ptsecurity.com> (raw)
Good day!
First, let me show how it looks and feels on my system:
[deepfire@andromedae:~/repro-kernel-loop-mount]$ uname -a
Linux andromedae 3.14.22 #1-NixOS SMP Thu Jan 1 00:00:01 UTC 1970 x86_64 GNU/Linux
[deepfire@andromedae:~/repro-kernel-loop-mount]$ ls
repro.sh
[deepfire@andromedae:~/repro-kernel-loop-mount]$ cat repro.sh
#!/bin/sh
test -d dir/rec || mkdir -p dir/rec
test -d dir/proc || mkdir -p dir/proc
mount --bind . dir/rec
mount --make-private --make-unbindable dir/rec
mount none -t proc dir/proc
umount dir/rec
umount dir/proc
[deepfire@andromedae:~/repro-kernel-loop-mount]$ time sudo ./repro.sh
real 0m0.045s
user 0m0.012s
sys 0m0.007s
[deepfire@andromedae:~/repro-kernel-loop-mount]$ time sudo ./repro.sh
real 0m0.035s
user 0m0.009s
sys 0m0.009s
[deepfire@andromedae:~/repro-kernel-loop-mount]$ time sudo ./repro.sh
real 0m0.042s
user 0m0.012s
sys 0m0.010s
[deepfire@andromedae:~/repro-kernel-loop-mount]$ time sudo ./repro.sh
real 0m0.039s
user 0m0.013s
sys 0m0.011s
[deepfire@andromedae:~/repro-kernel-loop-mount]$ time sudo ./repro.sh
real 0m0.043s
user 0m0.009s
sys 0m0.011s
[deepfire@andromedae:~/repro-kernel-loop-mount]$ time sudo ./repro.sh
real 0m0.048s
user 0m0.011s
sys 0m0.013s
[deepfire@andromedae:~/repro-kernel-loop-mount]$ time sudo ./repro.sh
real 0m0.052s
user 0m0.016s
sys 0m0.012s
[deepfire@andromedae:~/repro-kernel-loop-mount]$ time sudo ./repro.sh
real 0m0.059s
user 0m0.008s
sys 0m0.031s
[deepfire@andromedae:~/repro-kernel-loop-mount]$ time sudo ./repro.sh
real 0m0.067s
user 0m0.005s
sys 0m0.042s
[deepfire@andromedae:~/repro-kernel-loop-mount]$ time sudo ./repro.sh
real 0m0.116s
user 0m0.011s
sys 0m0.088s
[deepfire@andromedae:~/repro-kernel-loop-mount]$ time sudo ./repro.sh
real 0m0.291s
user 0m0.009s
sys 0m0.262s
[deepfire@andromedae:~/repro-kernel-loop-mount]$ time sudo ./repro.sh
real 0m0.857s
user 0m0.011s
sys 0m0.819s
[deepfire@andromedae:~/repro-kernel-loop-mount]$ time sudo ./repro.sh
real 0m1.710s
user 0m0.012s
sys 0m1.634s
[deepfire@andromedae:~/repro-kernel-loop-mount]$ time sudo ./repro.sh
real 0m3.186s
user 0m0.010s
sys 0m3.023s
[deepfire@andromedae:~/repro-kernel-loop-mount]$ time sudo ./repro.sh
real 0m6.732s
user 0m0.013s
sys 0m6.032s
[deepfire@andromedae:~/repro-kernel-loop-mount]$ time sudo ./repro.sh
real 0m14.541s
user 0m0.008s
sys 0m12.115s
* * *
Some extra data points:
1. Exchanging the two umounts results in expected behavior
2. Exchanging the two umounts absolves the need in 'mount --make-private --make-unbindable dir/rec'
3. I don't see it on 3.12.something Ubuntu kernels
--
regards,
Серёга Косырев
next reply other threads:[~2014-10-30 12:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-30 12:07 Serge Kosyrev [this message]
2014-10-30 12:47 ` Frans Klaver
2014-10-30 22:43 ` Serge Kosyrev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87vbn1222e.fsf@ptsecurity.com \
--to=skosyrev@ptsecurity.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®