Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp59592imn; Wed, 3 Aug 2022 19:38:32 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vGaNN+/BjTDquAK/JgOL+tvclJA2fkqWUyl3LF0UrtIm82e6uqA9mWDh6EPCBoWWjLP2cs X-Received: by 2002:a17:907:7388:b0:730:3c40:d9ec with SMTP id er8-20020a170907738800b007303c40d9ecmr20112744ejc.108.1659580712240; Wed, 03 Aug 2022 19:38:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659580712; cv=none; d=google.com; s=arc-20160816; b=bmOdNo5oAZhsSXAxjf2a0AVVUfGTNCWw4k9ewMotsge/Lcs795Z5qA2ZXkEClImfCO TXJnIyiZ3OwabeJUHQZgn2vTF6QeiMq4t+i9dCwDZyRCv1iT3/Uoqoz7ZDCeRyvDtOxf Xesi0bfek+ZrP0n8mwegY56M7J+LBsiKUw2Yi0aPIljNMO7dv+CFUVIPu/rH5YBYyhFW O4fSlTyko9nbkAmV/Akd883VMW8dw+VfqsB5FfECfGDHtJULtlS4EUUUZpGfnl2nLxFj 0YMxPxEYVsf6wNWAhSRsvKLkeyJ4c+2BGZKkEOL3ovk96y8sKLvtdrsPJ1MBwMV7PASm S+Kw== 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=gWfB+VoJpyYH7MVy8NFfYamTDBAr8iMYEneTb6NC9lw=; b=j2AVRN+HPsX1dJz9T5OTw5mJh064lRfbHxTvbGQ0KuVFEBFG3z9kpMFuh5t1GfjEhD 1f5H2F4w41oUi9pADozUDp79pM8FylRoTeU5oTMz4oCPeloooSkySmqA5+MhsX17KJES /ez7Ygf8RcXwt8nkxbVawGuxcYjMgJMIMvWPRtButkv9xxPFnzrTQ0omdwg/Upt8JJJZ MVw9mdUbBN7YQ3pcz77U3OK5dL5GNvbia6PoPB9yN/EjqiuovhFRj6fxCJwQV72LzFI1 F1+UKPZiDZfqhv8ZfSrb6TBoIvPF8GZgZvRD99JJczAsKXXJ7dl6JB3n4uXWXaOpvlbz dCuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=AbMyIOhg; 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 hg4-20020a1709072cc400b0072b83c2b374si17873939ejc.62.2022.08.03.19.38.06; Wed, 03 Aug 2022 19:38:32 -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=@linux-foundation.org header.s=google header.b=AbMyIOhg; 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 S239348AbiHDCSS (ORCPT + 99 others); Wed, 3 Aug 2022 22:18:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239344AbiHDCRz (ORCPT ); Wed, 3 Aug 2022 22:17:55 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 712D561108 for ; Wed, 3 Aug 2022 19:16:40 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id dc19so11744197ejb.12 for ; Wed, 03 Aug 2022 19:16:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=gWfB+VoJpyYH7MVy8NFfYamTDBAr8iMYEneTb6NC9lw=; b=AbMyIOhgL2dl1hzzmxIOuXXLlv2CHsUHyc0nBU0b9kYHeBhKNJpvT4yy4gbNcHULNL lELD4wT/TU/PA4httB4Gp0LkUc5L81fXdda4je4IfbFClE7yrwfgNhqGJjJ2aClFDO3Z vNlGwYP5ZH/Id4nKRTdzm9trYbDJX4uWZXjXM= 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; bh=gWfB+VoJpyYH7MVy8NFfYamTDBAr8iMYEneTb6NC9lw=; b=sC00+cyLGsbkJfbMtWR9SSbmiTFarYl7e4CNo8DKa+dnSMpKtd+rfEWwN2x9RTmMeO DBkMvRwfclJGrYhz2wLI55eBydeg8Mr5JctAbq0hHa8/sAhT5gTezqknVnO8uz8sa9Lh xfLMzIxZHugGmVFqL/XURcn0jslHTr28LG6dyCsZItVb5on6TWNHQxrzpUi7A+eEyOqJ yJvEUJyRNWp+DhXjgrz1WJJ7egwlo2Ms6OEpcRaw6NFvo5G56C5GKyoPjKZcW8eUXmVT ADiNEdgDuHDH3qbZTVLqDsaYcZ3uA5Hw37t18/FkIWSZFJjekfU3JL6Dpvh94Kz0KlB6 HdIg== X-Gm-Message-State: AJIora97teszIcAHvnRxrvrDxBXn1sLVGD/tJLolFUXMONc5fV/iZHdu o0bXx7Go14/yFVo0FdcaDVlDnyg6S21IQD/x X-Received: by 2002:a17:906:1315:b0:72c:5348:a153 with SMTP id w21-20020a170906131500b0072c5348a153mr22089492ejb.446.1659579390471; Wed, 03 Aug 2022 19:16:30 -0700 (PDT) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com. [209.85.128.44]) by smtp.gmail.com with ESMTPSA id 17-20020a170906201100b006fee98045cdsm99527ejo.10.2022.08.03.19.16.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Aug 2022 19:16:29 -0700 (PDT) Received: by mail-wm1-f44.google.com with SMTP id i128-20020a1c3b86000000b003a3a22178beso1797757wma.3 for ; Wed, 03 Aug 2022 19:16:29 -0700 (PDT) X-Received: by 2002:a05:600c:2d07:b0:3a3:585:5d96 with SMTP id x7-20020a05600c2d0700b003a305855d96mr4620406wmf.38.1659579388908; Wed, 03 Aug 2022 19:16:28 -0700 (PDT) MIME-Version: 1.0 References: <20220803185936.228dc690@gandalf.local.home> <20220803213255.3ab719e3@gandalf.local.home> In-Reply-To: <20220803213255.3ab719e3@gandalf.local.home> From: Linus Torvalds Date: Wed, 3 Aug 2022 19:16:12 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [git pull] vfs.git pile 3 - dcache To: Steven Rostedt Cc: Matthew Wilcox , Al Viro , Sebastian Andrzej Siewior , Thomas Gleixner , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 Wed, Aug 3, 2022 at 6:33 PM Steven Rostedt wrote: > > 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. I think you're missing Willy's point - the use would be to verify that the spinlock really *is* held, because that's what disables preemption on non-RT. But no, I don't think it's worth the pain to have to specify which spinlock is held, because the spinlock might have been taken by the caller and we don't even have access to it - or care - we just know somebody did take it. If we want extra debuggingm it might be something like just verifying that yes, the preempt count (on a non-RT preemptible kernel) really is elevated already. > I wonder if raw_preempt_disable() would be another name to use? NO! The point is that normal non-RT code does *not* disable preemption at all, because it is already disabled thanks to the earlier spinlock. So we definitely do *not* want to call this "raw_preempt_disable()", because it's actually not supposed to normally disable anything at all. Only for RT, where the spinlock code doesn't do it. Linus