Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp2764515rwi; Tue, 1 Nov 2022 11:24:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM45tsg891gO4BkrFsZ9zONj/Tq6cP2lBEnVYZQgykS2eemGS7OYjX9kODmjYNNcLaHwcpMH X-Received: by 2002:a63:1f5c:0:b0:469:d0e6:dac0 with SMTP id q28-20020a631f5c000000b00469d0e6dac0mr17758281pgm.427.1667327088845; Tue, 01 Nov 2022 11:24:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667327088; cv=none; d=google.com; s=arc-20160816; b=Hy9e9wOfl4NIjgj2z28CuqGn2ecKM5dfA1P1XtamQESH6EnEHwFRoT5FiJDS4iKK/7 +GV2jNyw3PbRS9r68fvlEOQYbF1XP1j3kvdzbD2j0Lf9eUXGThk8AVjZlTPO1VT608zl PklC/uKeQVpWof46KGwHHQuPkusNVdfdiFXfO/ccHPLGhuuFF+Tus9YSz61i4EDit5A2 iuBvfos0CY/tlXGgAXTyHw/q28LwLuwbnG3CZ32ETzJ0iW4gEiQjFMM5KduQu7s1a+ge lkfvdEjp3i3mg9+NH8i87wiQwgFOeQ697XdWMOWNB/Sz9MNel/wi6Pq+SyurOuSfEI9F IpjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=8Hu2igDpV58FWOpyGjErjvDHZCw49fVJ+gWTy+xKV5E=; b=nUk0MPjh9wNvQQRovf3oTVU9SAhS6Qkfvnk/2APhoOWiSpaC3SZ4Nc5etuWBU0P4MQ VMnDmF8qiuyXUY3UsDWXGj+j9wntbTtpoXY2cGvyt4JvuKsjpOQorVoLvzekn+t1+1SF 7buo72BozLvQoyB99S4vfSoDefq6K2snvY/eCqG4v/RBVxuBTKBeP9jKW1oa03uqs6gi ZOQuKTT7TkW4Ask4csaYjGPFLdSYKd8TWMKJx8Iz/Z5ckGiG2zwLp6oX1UsK9DW71hsr 6Y5sTQeX/5Yw42DAmiJAcKOC/RYfX/h6N2LqS0y7a57ACAQOvuVJxneGs6xjUUuAJUP/ uhmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=y9wYpip6; dkim=neutral (no key) header.i=@suse.cz; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b5-20020a170902e94500b0017829e27195si12817853pll.521.2022.11.01.11.24.36; Tue, 01 Nov 2022 11:24:48 -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=@suse.cz header.s=susede2_rsa header.b=y9wYpip6; dkim=neutral (no key) header.i=@suse.cz; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230019AbiKARvt (ORCPT + 96 others); Tue, 1 Nov 2022 13:51:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbiKARvr (ORCPT ); Tue, 1 Nov 2022 13:51:47 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1F1D1C43D; Tue, 1 Nov 2022 10:51:46 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 77152336C4; Tue, 1 Nov 2022 17:51:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1667325105; h=from:from:reply-to: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=8Hu2igDpV58FWOpyGjErjvDHZCw49fVJ+gWTy+xKV5E=; b=y9wYpip6Of0LxO5D0ICCZcxW5C4TSGGzJYTFjb+bKg3sU2k05k4D+/01EPPXlczTaEBRmB fbmiQ/N6jqun7+cAPgU8IAkRAhiPgew7XKrAjURzfU3Lu1w2crWuvxtj9JjG7w5lOm5dNy t+qapKKxG0oDUt/1dtxQO3ahJmGqKG4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1667325105; h=from:from:reply-to: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=8Hu2igDpV58FWOpyGjErjvDHZCw49fVJ+gWTy+xKV5E=; b=XhaNawLrRjMwML6jyojoDCga85WxaVolsa3sEPqf0UcePwfe2kmdA2uIEP5avYx0+Eb2P0 Dmgclk6xu5T1aGCw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 531561346F; Tue, 1 Nov 2022 17:51:45 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id vH08FLFcYWMHIwAAMHmgww (envelope-from ); Tue, 01 Nov 2022 17:51:45 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 3EC20A0700; Tue, 1 Nov 2022 18:51:44 +0100 (CET) Date: Tue, 1 Nov 2022 18:51:44 +0100 From: Jan Kara To: Stephen Brennan Cc: Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Amir Goldstein , Al Viro Subject: Re: [PATCH v3 0/3] fsnotify: fix softlockups iterating over d_subdirs Message-ID: <20221101175144.yu3l5qo5gfwfpatt@quack3> References: <20221021010310.29521-1-stephen.s.brennan@oracle.com> <20221028001016.332663-1-stephen.s.brennan@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221028001016.332663-1-stephen.s.brennan@oracle.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 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. 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. 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... Am I missing something? AFAIU this would allow us to avoid the games with the new connector flag etc... We would probably still need to avoid softlockups when setting the flag DCACHE_FSNOTIFY_PARENT_WATCHED but that should be much simpler (we could use i_rwsem trick like you do). Honza -- Jan Kara SUSE Labs, CR