Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp47897imn; Wed, 3 Aug 2022 19:05:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uIg7oM/mAfTGykI4BtZpukbZD7KgvAG4QRtMuhnOqK/Xy/y4Q38h8jVG/UBDEZ/w5GutYx X-Received: by 2002:a17:906:58d0:b0:72e:e25a:46e7 with SMTP id e16-20020a17090658d000b0072ee25a46e7mr22127941ejs.459.1659578741420; Wed, 03 Aug 2022 19:05:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659578741; cv=none; d=google.com; s=arc-20160816; b=L2dlwaLcqNexZOugYZsajg5Sb3tvn5MVsb7SM9FsgMehjAaNuTU4mKuf9bcL1I+y3W ILacbNE++leTqxJ5xJHSn2NJKQp1j46HYgM2ciDTyKcGO+FVKsvEcQVd6LpgYcyZjL4o 4wpr2Ij3btjJsFV5e+Tze7QjYQrginl1rHw/hOIj0nKjsy/2z+dPseJdMv8yId+AcRJU dpUA/9EalBVpJh20AFyVc45d/fI4hvQjPK7uKwzdf4m/YQExpaeWMTXhrjo4V7bWtAna 1nplfKyZhzVpqMUviPpAXkdbrRLcP3w4K2DyoTazbnkEOMEsfMrkO5Dx/x231F+DlQDI pTrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=mv1HZZjmUI5bO2OgsIcp1Qs+uXL3uvg3fIC7SKi9p90=; b=G3f68gK/ZNBlHZ9EkV0I8FxedAhZxY6snId2J1mN4OWiJpXE/AePdFqKvzmZvuc7ZZ 2vtYPnW7Iyog+OWXmA8dlsLeZL96rY0eNs7R/6hiVlzkyoNIMnacrWeBh9NxDdpc82Qi 0aS4Sd3tFQ01bn8h/q9PSDwMn00Zb2CbA/3LFSqzDXxH4HjFeDsY5G6fqCsUYdlCBH9r RfP9Fd8dmmlabugBUpWujpZKcANHBWY3C0BPPrwHbMPdmT9ZzfjBAPVSPaMffHowmhCi UZYYdiATOE0DIItnoXAkLmyrJ27gwGBKZFxvcrCWagJCRSjHSBjZFAs028W58BSgRlle g22Q== ARC-Authentication-Results: i=1; mx.google.com; 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 f12-20020a170906c08c00b0072f6967225bsi14568013ejz.314.2022.08.03.19.05.15; Wed, 03 Aug 2022 19:05:41 -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; 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 S238461AbiHDBdB (ORCPT + 99 others); Wed, 3 Aug 2022 21:33:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229728AbiHDBdA (ORCPT ); Wed, 3 Aug 2022 21:33:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E07D5A3EF; Wed, 3 Aug 2022 18:32:59 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 156166175E; Thu, 4 Aug 2022 01:32:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 951A6C433C1; Thu, 4 Aug 2022 01:32:57 +0000 (UTC) Date: Wed, 3 Aug 2022 21:32:55 -0400 From: Steven Rostedt To: Matthew Wilcox Cc: Linus Torvalds , Al Viro , Sebastian Andrzej Siewior , Thomas Gleixner , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [git pull] vfs.git pile 3 - dcache Message-ID: <20220803213255.3ab719e3@gandalf.local.home> In-Reply-To: References: <20220803185936.228dc690@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,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 On Thu, 4 Aug 2022 01:42:25 +0100 Matthew Wilcox wrote: > > So let's make it verbose and clear and unambiguous. It's not like I > > expect to see a _lot_ of those. Knock wood. > > Should we have it take a spinlock_t pointer? We could have lockdep > check it is actually held. We don't care if the lock is held or not. The point of the matter is that spinlocks in RT do not disable preemption. The code that the preempt_disable_under_spinlock() is inside, can not be preempted. If it is, bad things can happen. Currently this code assumes that spinlocks disable preemption, so there's no need to disable preemption here. But in RT, just holding the spinlock is not enough to disable preemption, hence we need to explicitly call it here. As Linus's name suggests, the "preempt_enable_under_spinlock" is to make sure preemption is disabled regardless if it's under a normal spinlock that disables preemption, or a RT spinlock that does not. I wonder if raw_preempt_disable() would be another name to use? We have raw_spin_lock() to denote that it's a real spinlock even under PREEMPT_RT. We could say that "raw_preempt_disable()" makes sure the location really has preemption disabled regardless of PREEMPT_RT. -- Steve