Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934727AbcJFTsd (ORCPT ); Thu, 6 Oct 2016 15:48:33 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:57306 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933299AbcJFTs0 (ORCPT ); Thu, 6 Oct 2016 15:48:26 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Andrei Vagin Cc: Alexander Viro , containers@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org References: <1475772564-25627-1-git-send-email-avagin@openvz.org> Date: Thu, 06 Oct 2016 14:46:30 -0500 In-Reply-To: <1475772564-25627-1-git-send-email-avagin@openvz.org> (Andrei Vagin's message of "Thu, 6 Oct 2016 09:49:24 -0700") Message-ID: <87eg3tclbd.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=1bsEeW-0004Zp-EE;;;mid=<87eg3tclbd.fsf@x220.int.ebiederm.org>;;;hst=in01.mta.xmission.com;;;ip=75.170.125.99;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX18HklREvhLHINKQiD5KEppTi+5QjLcaZMI= 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 * [sa03 1397; Body=1 Fuz1=1 Fuz2=1] * 1.0 T_XMDrugObfuBody_08 obfuscated drug references * 0.0 T_TooManySym_01 4+ unique symbols in subject * 0.0 T_TooManySym_02 5+ unique symbols in subject X-Spam-DCC: XMission; sa03 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: *;Andrei Vagin X-Spam-Relay-Country: X-Spam-Timing: total 419 ms - load_scoreonly_sql: 0.05 (0.0%), signal_user_changed: 4.1 (1.0%), b_tie_ro: 3.0 (0.7%), parse: 1.17 (0.3%), extract_message_metadata: 25 (6.0%), get_uri_detail_list: 1.80 (0.4%), tests_pri_-1000: 11 (2.5%), tests_pri_-950: 2.1 (0.5%), tests_pri_-900: 1.62 (0.4%), tests_pri_-400: 29 (6.9%), check_bayes: 27 (6.5%), b_tokenize: 9 (2.2%), b_tok_get_all: 8 (1.8%), b_comp_prob: 3.3 (0.8%), b_tok_touch_all: 2.4 (0.6%), b_finish: 0.87 (0.2%), tests_pri_0: 333 (79.4%), check_dkim_signature: 0.78 (0.2%), check_dkim_adsp: 4.3 (1.0%), tests_pri_500: 7 (1.7%), 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 in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1245 Lines: 33 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. The order of traversal is important if there are several things mounted one on the other that are all being unmounted. Now perhaps your other changes have addressed that but I haven't looked closely enough to see that yet. > @@ -454,7 +473,7 @@ int propagate_umount(struct list_head *list) > list_for_each_entry_reverse(mnt, list, mnt_list) > mark_umount_candidates(mnt); > > - list_for_each_entry(mnt, list, mnt_list) > + list_for_each_entry_reverse(mnt, list, mnt_list) > __propagate_umount(mnt); > return 0; > } Eric