Received: by 2002:a05:6512:3d0e:0:0:0:0 with SMTP id d14csp16888lfv; Tue, 12 Apr 2022 15:24:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyI2SixTztY6oEUrupC7UYtj1EfYeRUc5H9PadIAAp//skiIPBq6UaPKE5IZ8zkEohUkPk2 X-Received: by 2002:a63:7888:0:b0:398:91:7b5e with SMTP id t130-20020a637888000000b0039800917b5emr32669827pgc.212.1649802269763; Tue, 12 Apr 2022 15:24:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649802269; cv=none; d=google.com; s=arc-20160816; b=VvSmJPBbYwgIQxe/ZXfcSCXUwBPkIhJV2kTptQ7wuvY63gWAxu+P2gGHkmg+jCu+ud vlyijfFdck7sApy3rbm2Jp5NUlNYxhkw+tlEhkcPpqlJW8G37Z/yUMh3JzB7xdwLcqFQ /Xe5jt87a/PvReVuiW6TOO1gWL7B5BQ9EsSzMtQp9bJNcfegnEUdB9ozrQFRbCotrE5i T8jAH7U1kg9/FAOYo2EiI47c6JSneePCYnxhOkCQXyf9azIJuMgQRjUzL+TdzJIMUxWu KByJp5UFwW/DVCxs0JrNBJ3/O2amp819YQrCBV/H2xAbUGlJ/qrTg7dBWnWUmCs5DfjH 4rHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:mail-followup-to:reply-to:message-id :subject:cc:to:from:date:dkim-signature:dkim-signature; bh=jvZneIfxjRcQNcfnf0BL0BqjsNa/YtuGQgAtBxUt7x4=; b=LqyBOvYRKhVbXoKl9mAVIM/vgyUFxINzwAj23BJORdN4M7X/SJ5cjuLWvRRaA0qw9d QplIW7W7fs/XkOEE72Uh3FTiryL5vIui7YOtLY3sK9NNV1URu2OyTmBMzL0EptFvkfok NGaBL+ipBDRggqhE9A6GuwM3RMl1acsM3PIQrP755vmpU+MDo/SU4aP8sJWRH2PC8aFt DPBCwcgE2KQd3hddl90UdbwNXHzWjWFaXuKNN6DgZ7oJdVnPlOx36OOSKlcFPyB/1h9t ztg4jSIlnkp3Q5Tg20rIZSUlz7gnA2hkWFTKPn9FH3PetFkChJjkyYRoxDRwCVMi6btT GElA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=WsTZTZAh; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id o17-20020a170902779100b001584547f62esi9262686pll.256.2022.04.12.15.24.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 15:24:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=WsTZTZAh; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A75B517B0CD; Tue, 12 Apr 2022 14:04:12 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237243AbiDKN6E (ORCPT + 99 others); Mon, 11 Apr 2022 09:58:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346812AbiDKN6C (ORCPT ); Mon, 11 Apr 2022 09:58:02 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1CB521266; Mon, 11 Apr 2022 06:55:42 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 7EE7D1F38D; Mon, 11 Apr 2022 13:55:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1649685341; h=from:from:reply-to: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=jvZneIfxjRcQNcfnf0BL0BqjsNa/YtuGQgAtBxUt7x4=; b=WsTZTZAhI1CWBJF1IFXNYX+jawIqOs6VInW0XC/ooLvJyCyJTEiVdgDJMXley1SFUhavum TKY+7RxXhJuXfBjvRS9X64iOtB9PqcHHYD7GVugjQdheTazn0ZmDG1R0AzcfqL2Jq09mK5 +4oKfD/74Xi4lO33LZeMFMT5X/drwc0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1649685341; h=from:from:reply-to: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=jvZneIfxjRcQNcfnf0BL0BqjsNa/YtuGQgAtBxUt7x4=; b=7KelmgT2O9nBRze2q8H41Z0itF/hOYujFvQV/SWzqSqcS86nxwYWS//undgsd0zVXII5zD EnF7qWEtg7ZjnyBA== Received: from ds.suse.cz (ds.suse.cz [10.100.12.205]) by relay2.suse.de (Postfix) with ESMTP id 74B26A3B87; Mon, 11 Apr 2022 13:55:41 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 1C25CDA7DA; Mon, 11 Apr 2022 15:51:37 +0200 (CEST) Date: Mon, 11 Apr 2022 15:51:37 +0200 From: David Sterba To: Schspa Shi Cc: clm@fb.com, Josef Bacik , dsterba@suse.com, terrelln@fb.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] btrfs: zstd: use spin_lock in timer function Message-ID: <20220411135136.GG15609@suse.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Schspa Shi , clm@fb.com, Josef Bacik , dsterba@suse.com, terrelln@fb.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220408181523.92322-1-schspa@gmail.com> <20220408184449.GB15609@twin.jikos.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Sat, Apr 09, 2022 at 03:36:54PM +0800, Schspa Shi wrote: > David Sterba writes: > > > On Sat, Apr 09, 2022 at 02:15:23AM +0800, Schspa Shi wrote: > >> timer callback was running on bh, and there is no need to disable bh again. > > > > Why do you think so? There was a specific fix fee13fe96529 ("btrfs: > > correct zstd workspace manager lock to use spin_lock_bh()") that > > actually added the _bh, so either you need to explain why exactly it's > > not needed anymore and verify that the reported lockdep warning from the > > fix does not happen. > > Yes, I've seen this fix, and wsm.lru_list is protected by wsm.lock. > This patch will not remove all changes that were fixed. Just a little > improvement > to remove the unnecessary bh disabling. Like > static inline void red_adaptative_timer(struct timer_list *t) > in net/sched/sch_red.c. > > Because the critical section is only used by the process context and > the softirq context, > it is safe to remove bh_disable in the softirq context since it will > not be preempted by the softirq. So why haven't you written that as a proper explanation the first time, you apparenly analyzed the correctness. Please update the changelog and also please try to rephrase it so it's more readable, I kind of understand what you mean but it still leaves some things to hard to read. Thanks.