Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp2391059rwb; Fri, 20 Jan 2023 02:14:05 -0800 (PST) X-Google-Smtp-Source: AMrXdXu6Fb1UI7hZWGDZUB9QZAA1ez2Ej0/ed95AoXM3rAcqJ3Y07YY51RfrXh+wGyEtweFYUj/Y X-Received: by 2002:a05:6a20:4b30:b0:b9:40b7:76c3 with SMTP id fp48-20020a056a204b3000b000b940b776c3mr4557555pzb.61.1674209645545; Fri, 20 Jan 2023 02:14:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674209645; cv=none; d=google.com; s=arc-20160816; b=BdRwSIWvpYez68+f1NFaPlV76WaWZjDWjfMjjwVxGm9k7B9xGTDCB5dKhIqwt4Zoc1 J+/JabhPhurEpfwYdc2nIXYPs3jdu9CrypjATepCsL1iIw7st6qIHojNuhOQKs97HqBF z9teOCxzN6YT6q5BlAfWde44OTUVLW2sZ0lOBjGSbPgwcR9I5TCSlvP4hzWQQAUOhpal C2N09RVxWY4yMiHFiulhwp8SIViRYtmOCUXNJmmoptEl0FFwqf45FCSK/GuuXtPirRPr N7KxxwWCjwmhDFw35OQj8pMvh1ZNEq2SyjOmIErWimZ4p55duJqJ1OSco56WI7nHwyuu T+LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=2ieVgb0wdTbUDgdUwiBcUCrz7AjasaHhJqwRtTkIp84=; b=J+QSflLCsBQ3IXalLOk6f6SWZI8LPcmSvhgo12m7hV/6xk6gkVaZYOXXTG6s8W0dHJ 1BZjt70EqmxN21psEHwB8roiz1SCdYv4WVo8jqgn8XOH8P7DkedM5xFxhau9EMOcbgG0 pzWrt0D3E7+JlX7vMTVhtq3vg09OupJyA6N8Nl3Xxu3DyNGdG0TR0ZrrmMTDkpCkSUeX ZFmyRycGTO04wN+Pz12ZZS7TowOaAM0/eS8Oa8fX8dP4vY3VZfDvQt0KmVYjEru8Ot1q eJ87TXV7yiOR3oiN+8t8BDT0gQX77K6FRyPG10HmOMXwGwdSO3eMRk7vPZD373OQRInL dLjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ViGyrr9r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds12-20020a17090b08cc00b00229ca3db2a5si2020362pjb.77.2023.01.20.02.13.59; Fri, 20 Jan 2023 02:14:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ViGyrr9r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229558AbjATIoX (ORCPT + 48 others); Fri, 20 Jan 2023 03:44:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229523AbjATIoW (ORCPT ); Fri, 20 Jan 2023 03:44:22 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC1297CCC3 for ; Fri, 20 Jan 2023 00:43:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674204215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2ieVgb0wdTbUDgdUwiBcUCrz7AjasaHhJqwRtTkIp84=; b=ViGyrr9r9RuIq3OK2pb8ZkVSoTmzKFGBFv7Brluoaq/8+C8aKF4XoOEAJB5NEJYqOzP2y1 0/f2Q9IHbHbyQrJIotWwMfNLvWdIvuSsRpNVsPigjA0f+oYOwkzpmayM/7L6rWDLU2tho1 p0OB4rq3Mbfpk4wf5eMu4mdJSeXoKa0= Received: from mail-il1-f197.google.com (mail-il1-f197.google.com [209.85.166.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-413-_2y19hoYM36dLV07yf79ag-1; Fri, 20 Jan 2023 03:43:33 -0500 X-MC-Unique: _2y19hoYM36dLV07yf79ag-1 Received: by mail-il1-f197.google.com with SMTP id y5-20020a056e021be500b0030bc4f23f0aso3354810ilv.3 for ; Fri, 20 Jan 2023 00:43:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2ieVgb0wdTbUDgdUwiBcUCrz7AjasaHhJqwRtTkIp84=; b=VRLQqgoc6otOImPssLq9Tkz+reuPtI2LmWHrwrQLPH0V5Lz9A3pLgA+0qFAI/K05TN vtnV6i6YISLn/ygFeAztgVQU7oMRk8nt8syNqeK/yresYQGnzrMC74YG8E4HR5NkX78G odmDW2N6XNxgpliUFrdYRgyUOhiYfGAnqYaq3nJwolIWBdbCY6bTYEU3OCTelEWV3MrN CPsk7Ru/wRj/+CbW5Co3qN7pSIZBLv6EnO1M3yiOM+KAIau+90o2E6CNXOB4yz05p1v0 8kDDqN//yszDTW+EcUkr7ic9CdXw03+bR/UPF5WUrsIz+77dv4wVZ8J7pHSQ0FUfoQMH YfTw== X-Gm-Message-State: AFqh2kqP8gVhb8YP3v8dG8/imIbf5x1kGH5Ed1ykCgJU48hJSeCFbcFz 1ilHiMm9rP5ycus2YDwCr+pUGxWgy9NubO3HzLS0duYZ/ir4tLdk5Z8yiZvvl8DEyprwuWvG2RP H6+Vna84rEP433X4VEcxsFOQD3GE8YbmwdMT7NDCW X-Received: by 2002:a5d:884b:0:b0:704:d851:64ba with SMTP id t11-20020a5d884b000000b00704d85164bamr818293ios.135.1674204212930; Fri, 20 Jan 2023 00:43:32 -0800 (PST) X-Received: by 2002:a5d:884b:0:b0:704:d851:64ba with SMTP id t11-20020a5d884b000000b00704d85164bamr818292ios.135.1674204212712; Fri, 20 Jan 2023 00:43:32 -0800 (PST) MIME-Version: 1.0 References: <20230119211455.498968-1-echanude@redhat.com> <20230119211455.498968-2-echanude@redhat.com> In-Reply-To: From: Alexander Larsson Date: Fri, 20 Jan 2023 09:43:21 +0100 Message-ID: Subject: Re: [RFC PATCH RESEND 1/1] fs/namespace: defer free_mount from namespace_unlock To: Al Viro Cc: Eric Chanudet , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org, Andrew Halaney Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 19, 2023 at 11:09 PM Al Viro wrote: > > On Thu, Jan 19, 2023 at 04:14:55PM -0500, Eric Chanudet wrote: > > From: Alexander Larsson > > > > Use call_rcu to defer releasing the umount'ed or detached filesystem > > when calling namepsace_unlock(). > > > > Calling synchronize_rcu_expedited() has a significant cost on RT kernel > > that default to rcupdate.rcu_normal_after_boot=1. > > > > For example, on a 6.2-rt1 kernel: > > perf stat -r 10 --null --pre 'mount -t tmpfs tmpfs mnt' -- umount mnt > > 0.07464 +- 0.00396 seconds time elapsed ( +- 5.31% ) > > > > With this change applied: > > perf stat -r 10 --null --pre 'mount -t tmpfs tmpfs mnt' -- umount mnt > > 0.00162604 +- 0.00000637 seconds time elapsed ( +- 0.39% ) > > > > Waiting for the grace period before completing the syscall does not seem > > mandatory. The struct mount umount'ed are queued up for release in a > > separate list and no longer accessible to following syscalls. > > Again, NAK. If a filesystem is expected to be shut down by umount(2), > userland expects it to have been already shut down by the time the > syscall returns. > > It's not just visibility in namespace; it's "can I pull the disk out?". > Or "can the shutdown get to taking the network down?", for that matter. In the usecase we're worrying about, all the unmounts are lazy (i.e. MNT_DETACH). What about delaying the destroy in that case? That seems in line with the expected behaviour of lazy shutdown. I.e. you can't rely on it to be settled anyway. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Alexander Larsson Red Hat, Inc alexl@redhat.com alexander.larsson@gmail.com