Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp3731509rwi; Wed, 2 Nov 2022 02:24:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5taDQfixNsNVujA4u70Z5Uor3VyvJO5KM39/U7iUGH2dKAunZejbWCnndCEZtQpplk4s5r X-Received: by 2002:a17:907:628f:b0:72f:58fc:3815 with SMTP id nd15-20020a170907628f00b0072f58fc3815mr22183457ejc.719.1667381064175; Wed, 02 Nov 2022 02:24:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667381064; cv=none; d=google.com; s=arc-20160816; b=Jtik9qxRTC62cUhiJJt5WZr/1j8KAXoi64eUmTUyPbyOVgI5W8z3hWZo6GAD9phdyH Rs3q6RsEdhD3YbM7P5ClmgN3v0nZoPym/MU2mQL7Fcsmyxic/iyyek7Ja5hNIQIeCJRL hWf9N6R+F9chCHQ3A3K0uZwtpdhez/w5DNjgwwN9LM1gd9RijjlE38WzeDGqey+V0kF3 v/6wwfSgbK26f0Vm3notoAP9X3rXM/MJXxM3LDKWBO5NNPiJ1hyhuidA5s+4frRrWL6H x3tSSjBz0LfyhyIm/Dz46rUrBraKmDk2Lnl+LlTUJif/VZmbfXc6Up4XikEPwKRRQU9n 2B0g== 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=8u/qv2jL7ReMKujRrkoVq2CcT03zgxq0ws72lCTuzcE=; b=nENZhNVG68ZCrVNti45v00M5Bi1m4ezPwJU/ZJkcOtAYtc8IFVMdSLqLFA3kS/yC4b Sdmq9wECu4jc/x0UFRpRB8svzM865CCi9h7/g4BTylQQTwz/fTZK4XePedPw1PI8Wggh VQHLjOPNue5ED16c53hnv5hRbLozzUEBVuqKSgHmfIP1vtgFxCHAF17hrz73dGfGBVZq pgEABmii6MXlRT+ccdrx4LLHy86rpjtwXxFNp1sWo2CtrYaot8SUioLfy5dMyTL6vvjs oyTijjYo4Vy/XONLps6GPiXI3f3HnmjpHHdxueQGtkA2FMrgAWRoRbY1aTgcePanGyR/ Aj0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cigxBDHV; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y11-20020a056402358b00b0045cea9cf231si17227079edc.566.2022.11.02.02.23.59; Wed, 02 Nov 2022 02:24:24 -0700 (PDT) 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=@gmail.com header.s=20210112 header.b=cigxBDHV; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230343AbiKBIzV (ORCPT + 98 others); Wed, 2 Nov 2022 04:55:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230365AbiKBIzQ (ORCPT ); Wed, 2 Nov 2022 04:55:16 -0400 Received: from mail-ua1-x92e.google.com (mail-ua1-x92e.google.com [IPv6:2607:f8b0:4864:20::92e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C768824969; Wed, 2 Nov 2022 01:55:14 -0700 (PDT) Received: by mail-ua1-x92e.google.com with SMTP id t26so7319373uaj.9; Wed, 02 Nov 2022 01:55:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=8u/qv2jL7ReMKujRrkoVq2CcT03zgxq0ws72lCTuzcE=; b=cigxBDHVD5ZANzyZnqhwPRfDQXKs7vIPENgo4sVS15AuaCwDJwd0xTEFSWPfe1MiM4 mRMmzPFIV6PP9bFMV6hxloONA7XZpxxbvD3cjkHDblo/AfO5Bedv9jk6T0R0U1bGX5l5 yJfDujMpQf7TsXpnxPWrBPF9U0JyPwl7FUexm8H1D8c3buhOwOBh8dt4EcDXIocZSSAc dWSQEL+N8gsVjMWxdTb0U75SKji7qcn77qTAsSOF/FV5crfAo1mmBPOY1+FaMfQhbBZl QuIBjq1ZQqMcZyOxhbtPSthpAWwz6eT/lrXi9Y+ThHxG+ZymU/smOXqM9Hjw4+GztF4X n8xw== 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=8u/qv2jL7ReMKujRrkoVq2CcT03zgxq0ws72lCTuzcE=; b=4mtNhFploAQyQWBWYKp7T6wfLEJ6VgwpbSFDvMlzv9JhCcel+kA8tdHcA4pgNua/yN 2CLFX3IJb4rCT2Ys3miZ/qnfc6lHDpzWRPNzTcwzWr8uYNGidKR3yd8Pb/0/Ppv9aLKF GxTgd2U22duhqD0xiQsB57SOeHZg9MYRNI3/GqCNucHPPhoGVxciHTB22wqW/JnBVkcn mxHeA6YpymRzmgyeU2AoMOjhYrv+G/RGuU6av43QTJ1ORPieIzL2TvQ1GLpj3iyzlTi3 skiQVVCKJiEIJYjpRk3oht4xUS6HnQOg/hkA4bImrNOXe+gleo1MW+D18bNH+cGoCgl2 kGcA== X-Gm-Message-State: ACrzQf20sP9mT8RF0Dwu9IsU7VMfCx3akdnxWFMhijasLSqS90HsQc16 trm7LKfL2oEm0GVsjveeJZglkgbWlB4g29uoniMljMEr0ws= X-Received: by 2002:ab0:7395:0:b0:40d:644c:a884 with SMTP id l21-20020ab07395000000b0040d644ca884mr8199900uap.9.1667379313761; Wed, 02 Nov 2022 01:55:13 -0700 (PDT) MIME-Version: 1.0 References: <20221021010310.29521-1-stephen.s.brennan@oracle.com> <20221028001016.332663-1-stephen.s.brennan@oracle.com> <20221101175144.yu3l5qo5gfwfpatt@quack3> <877d0eh03t.fsf@oracle.com> In-Reply-To: <877d0eh03t.fsf@oracle.com> From: Amir Goldstein Date: Wed, 2 Nov 2022 10:55:01 +0200 Message-ID: Subject: Re: [PATCH v3 0/3] fsnotify: fix softlockups iterating over d_subdirs To: Stephen Brennan Cc: Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Al Viro Content-Type: multipart/mixed; boundary="000000000000b3fafc05ec78ff3b" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 --000000000000b3fafc05ec78ff3b Content-Type: text/plain; charset="UTF-8" On Tue, Nov 1, 2022 at 10:49 PM Stephen Brennan wrote: > > Hi Jan, > > Jan Kara writes: > > Hi Stephen! > > > > On Thu 27-10-22 17:10:13, Stephen Brennan wrote: > >> Here is v3 of the patch series. I've taken all of the feedback, > >> thanks Amir, Christian, Hilf, et al. Differences are noted in each > >> patch. > >> > >> I caught an obvious and silly dentry reference leak: d_find_any_alias() > >> returns a reference, which I never called dput() on. With that change, I > >> no longer see the rpc_pipefs issue, but I do think I need more testing > >> and thinking through the third patch. Al, I'd love your feedback on that > >> one especially. > >> > >> Thanks, > >> Stephen > >> > >> Stephen Brennan (3): > >> fsnotify: Use d_find_any_alias to get dentry associated with inode > >> fsnotify: Protect i_fsnotify_mask and child flags with inode rwsem > >> fsnotify: allow sleepable child flag update > > > > Thanks for the patches Stephen and I'm sorry for replying somewhat late. > > Absolutely no worries, these things take time. Thanks for taking a look! > > > The first patch is a nobrainer. The other two patches ... complicate things > > somewhat more complicated than I'd like. I guess I can live with them if we > > don't find a better solution but I'd like to discuss a bit more about > > alternatives. > > Understood! > > > So what would happen if we just clear DCACHE_FSNOTIFY_PARENT_WATCHED in > > __fsnotify_parent() for the dentry which triggered the event and does not > > have watched parent anymore and never bother with full children walk? I > > suppose your contention problems will be gone, we'll just pay the price of > > dget_parent() + fsnotify_inode_watches_children() for each child that > > falsely triggers instead of for only one. Maybe that's not too bad? After > > all any event upto this moment triggered this overhead as well... > > This is an interesting idea. It came across my mind but I don't think I > considered it seriously because I assumed that it was too big a change. > But I suppose in the process I created an even bigger change :P > > The false positive dget_parent() + fsnotify_inode_watches_children() > shouldn't be too bad. I could see a situation where there's a lot of > random accesses within a directory, where the dget_parent() could cause > some contention over the parent dentry. But to be fair, the performance > would have been the same or worse while fsnotify was active in that > case, and the contention would go away as most of the dentries get their > flags cleared. So I don't think this is a problem. > I also don't think that is a problem. > > Am I missing something? > > I think there's one thing missed here. I understand you'd like to get > rid of the extra flag in the connector. But the advantage of the flag is > avoiding duplicate work by saving a bit of state. Suppose that a mark is > added to a connector, which causes fsnotify_inode_watches_children() to > become true. Then, any subsequent call to fsnotify_recalc_mask() must > call __fsnotify_update_child_dentry_flags(), even though the child > dentry flags don't need to be updated: they're already set. For (very) > large directories, this can take a few seconds, which means that we're > doing a few extra seconds of work each time a new mark is added to or > removed from a connector in that case. I can't imagine that's a super > common workload though, and I don't know if my customers do that (my > guess would be no). > > For an example of a test workload where this would make a difference: > one of my test cases is to create a directory with millions of negative > dentries, and then run "for i in {1..20}; do inotifywait $DIR & done". > With the series as-is, only the first task needs to do the child flag > update. With your proposed alternative, each task would re-do the > update. > > If we were to manage to get __fsnotify_update_child_dentry_flags() to > work correctly, and safely, with the ability to drop the d_lock and > sleep, then I think that wouldn't be too much of a problem, because then > other spinlock users of the directory will get a chance to grab it, and > so we don't risk softlockups. Without the sleepable iterations, it would > be marginally worse than the current solution, but I can't really > comment _how_ much worse because like I said, it doesn't sound like a > frequent usage pattern. > > I think I have a _slight_ preference for the current design, but I see > the appeal of simpler code, and your design would still improve things a > lot! Maybe Amir has an opinion too, but of course I'll defer to what you > want. > IIUC, patches #1+#3 fix a reproducible softlock, so if Al approves them, I see no reason to withhold. With patches #1+#3 applied, the penalty is restricted to adding or removing/destroying multiple marks on very large dirs or dirs with many negative dentries. I think that fixing the synthetic test case of multiple added marks is rather easy even without DCACHE_FSNOTIFY_PARENT_WATCHED. Something like the attached patch is what Jan had suggested in the first place. The synthetic test case of concurrent add/remove watch on the same dir may still result in multiple children iterations, but that will usually not be avoided even with DCACHE_FSNOTIFY_PARENT_WATCHED and probably not worth optimizing for. Thoughts? Thanks, Amir. --000000000000b3fafc05ec78ff3b Content-Type: text/x-patch; charset="US-ASCII"; name="fsnotify-clear-PARENT_WATCHED-flags-lazily.patch" Content-Disposition: attachment; filename="fsnotify-clear-PARENT_WATCHED-flags-lazily.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_l9ze346c0 RnJvbSBjOGVhMWQ4NDM5N2MyNmNlMzM0YmZmOWQ5ZjcyMTQwMGNlYmI4OGRkIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBBbWlyIEdvbGRzdGVpbiA8YW1pcjczaWxAZ21haWwuY29tPgpE YXRlOiBXZWQsIDIgTm92IDIwMjIgMTA6Mjg6MDEgKzAyMDAKU3ViamVjdDogW1BBVENIXSBmc25v dGlmeTogY2xlYXIgUEFSRU5UX1dBVENIRUQgZmxhZ3MgbGF6aWx5CgpDYWxsIGZzbm90aWZ5X3Vw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