Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752632AbcJGEry (ORCPT ); Fri, 7 Oct 2016 00:47:54 -0400 Received: from out02.mta.xmission.com ([166.70.13.232]:38034 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750801AbcJGErq (ORCPT ); Fri, 7 Oct 2016 00:47:46 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Andrei Vagin Cc: Andrei Vagin , Alexander Viro , , , References: <1475772564-25627-1-git-send-email-avagin@openvz.org> <87eg3tclbd.fsf@x220.int.ebiederm.org> <20161006230616.GA2296@outlook.office365.com> Date: Thu, 06 Oct 2016 23:45:48 -0500 In-Reply-To: <20161006230616.GA2296@outlook.office365.com> (Andrei Vagin's message of "Thu, 6 Oct 2016 16:06:28 -0700") Message-ID: <87twcoahs3.fsf@x220.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1bsN4R-0002VY-Ij;;;mid=<87twcoahs3.fsf@x220.int.ebiederm.org>;;;hst=in02.mta.xmission.com;;;ip=75.170.125.99;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX19QxW64lnrg2YXi5ENSUccv1HIZOley6bA= 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 * 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 * [sa06 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_02 5+ unique symbols in subject * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Andrei Vagin X-Spam-Relay-Country: X-Spam-Timing: total 470 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 3.5 (0.7%), b_tie_ro: 2.5 (0.5%), parse: 0.99 (0.2%), extract_message_metadata: 14 (3.0%), get_uri_detail_list: 1.52 (0.3%), tests_pri_-1000: 4.9 (1.0%), tests_pri_-950: 1.13 (0.2%), tests_pri_-900: 0.95 (0.2%), tests_pri_-400: 20 (4.2%), check_bayes: 19 (4.0%), b_tokenize: 6 (1.2%), b_tok_get_all: 6 (1.3%), b_comp_prob: 1.86 (0.4%), b_tok_touch_all: 2.6 (0.6%), b_finish: 0.67 (0.1%), tests_pri_0: 191 (40.7%), check_dkim_signature: 0.45 (0.1%), check_dkim_adsp: 3.4 (0.7%), tests_pri_500: 231 (49.1%), poll_dns_idle: 224 (47.6%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH v2] mount: dont execute propagate_umount() many times for same mounts 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: 1869 Lines: 44 Andrei Vagin writes: > On Thu, Oct 06, 2016 at 02:46:30PM -0500, Eric W. Biederman wrote: >> Andrei Vagin writes: >> >> > The reason of this optimization is that umount() can hold namespace_sem >> > for a long time, this semaphore is global, so it affects all users. >> > Recently Eric W. Biederman added a per mount namespace limit on the >> > number of mounts. The default number of mounts allowed per mount >> > namespace at 100,000. Currently this value is allowed to construct a tree >> > which requires hours to be umounted. >> >> I am going to take a hard look at this as this problem sounds very >> unfortunate. My memory of going through this code before strongly >> suggests that changing the last list_for_each_entry to >> list_for_each_entry_reverse is going to impact the correctness of this >> change. > > I have read this code again and you are right, list_for_each_entry can't > be changed on list_for_each_entry_reverse here. > > I tested these changes more carefully and find one more issue, so I am > going to send a new patch and would like to get your comments to it. > > Thank you for your time. No problem. A quick question. You have introduced lookup_mnt_cont. Is that a core part of your fix or do you truly have problmenatic long hash chains. Simply increasing the hash table size should fix problems long hash chains (and there are other solutions like rhashtable that may be more appropriate than pre-allocating large hash chains). If it is not long hash chains introducing lookup_mnt_cont in your patch is a distraction to the core of what is going on. Perhaps I am blind but if the hash chains are not long I don't see mount propagation could be more than quadratic in the worst case. As there is only a loop within a loop. Or Is the tree walking in propagation_next that bad? Eric