From mboxrd@z Thu Jan 1 00:00:00 1970 From: Willy Tarreau Subject: Re: [PATCH review 0/7] Bind mount escape fixes Date: Mon, 17 Aug 2015 00:29:29 +0200 Message-ID: <20150816222929.GA13710@1wt.eu> References: <20150815061617.GG14139@ZenIV.linux.org.uk> <874mk08l3g.fsf@x220.int.ebiederm.org> <87a8ts763c.fsf_-_@x220.int.ebiederm.org> <20150816021209.GI14139@ZenIV.linux.org.uk> <87egj3moxm.fsf@x220.int.ebiederm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Linus Torvalds , Al Viro , Linux Containers , linux-fsdevel , Andy Lutomirski , "Serge E. Hallyn" , Richard Weinberger , Andrey Vagin , Jann Horn , Omar Sandoval , Miklos Szeredi , "J. Bruce Fields" To: "Eric W. Biederman" Return-path: Received: from wtarreau.pck.nerim.net ([62.212.114.60]:12318 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751312AbbHPWaS (ORCPT ); Sun, 16 Aug 2015 18:30:18 -0400 Content-Disposition: inline In-Reply-To: <87egj3moxm.fsf@x220.int.ebiederm.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sun, Aug 16, 2015 at 06:51:33AM -0500, Eric W. Biederman wrote: > It occurs to me that there is a fairly simple way we can emperically > test to see how expensive calling is_subdir for every .. on a bind mount > is in practice. > > - Take my last patch > - run a benchmark outside of a bind mount (perhaps a kernel compile). > - run the same benchmark inside of a bind mount. > > See if the performance differs. > > I am going to try to find time to do this, but I am travelling for the > next couple of days. > > If someone who has a bit more time wants to try it and beats me to that > would be great. > > I think having some emperical numbers would be nice in this part of the > conversation. I took a bit of time to do something simpler though less scientific : I just ran a kernel build under strace -c -f to get a rough idea of the number of syscalls. It takes 2m23 without strace and 3m00 under strace. 7.2M syscalls were seen out of which only 3.2M were related to FS access (mostly open(), fstat() and stat()), the rest is minor. That's 22k syscalls per second, or 45 us between two syscalls. From this point I'm having a hard time imagining that any extra tests in the code path would have a significant impact to cause a measurable difference compared to these 45us, especially since I'm counting all FS accesses (worst case) and not just those referencing "..". Just my two cents, Willy