Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp550001imn; Wed, 3 Aug 2022 15:14:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR4M+ZlLgZnLda4jZ5UYskJipA4ZDbqpUyNpj6EsI3g2jxaOqJBsD0lYNelhETmEC3xJkUtL X-Received: by 2002:a62:ed0f:0:b0:52c:e8c2:b29e with SMTP id u15-20020a62ed0f000000b0052ce8c2b29emr24609280pfh.42.1659564852575; Wed, 03 Aug 2022 15:14:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659564852; cv=none; d=google.com; s=arc-20160816; b=z0EC8z4UubJLznjQgzdcyoAS/Zr0I8PthrIvlBRrT2XAs/NDDfxQbpbharX5+ebCun i5Ga/b/0V6N8AKdHn/677K8t/dE1eeWVR1xPqTx9lIxmL4Ngkp6INbsYXk/TuHO2hCnR Ik5FcNyxvkXSioEyKbBnQ03pQs5j7cXZbvhoOaJHdWtI1/SISWy3SLKXsEysUw9c91Xz dLuiCX+5iaI89sOFlT7xD1aiPJga+vGC2XzxwG5sEhSSgQ/8fK14HjbNUrE/xM+b3eYQ hBOk87eWCg/P3f+gmVDuVG7CYjOhx3fDgsoHziXzVZ1/nkXzEplfOlrWzeSacc8l1wr9 hCGw== 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; bh=Ob5R6pOI6VvGffrgyfhX+bNCfXti6sQGE2uxkYstDTc=; b=L/NRX42YFpdTseqt2vaxVfj1iE5vTQiUXYF61Wh3u6Eiw8wooZwowmicRA+hg4kHI7 zlfDiezMoWyE0WdXsYChgC1QcXaN6Wkic5iWvcC//J6oQnTCfoH1QOzZuUUsYOQXSoyS vHo+zYvJfuaUGEVNjkTA56/lcAwy/r/pRitLuJ4NVe7yvos8YqTOzZ/oew0kDm1TYhfE l1/mmp/NtLnLBuUa+Ycd0tigeZFMwhgcprmPDbLjMSO6yaBkQ6NM0My0IEC2mPLGcbjr /fLw8uD9CFxEjw7Gdu2CIGcl8+aWbJgqdyqqqI/NNZRiGuOCpM4UJmOM6bGM5krbuswB znsQ== 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 c11-20020a63d14b000000b00415d8740505si18999507pgj.499.2022.08.03.15.13.51; Wed, 03 Aug 2022 15:14:12 -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 S238135AbiHCVzC (ORCPT + 99 others); Wed, 3 Aug 2022 17:55:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230499AbiHCVzA (ORCPT ); Wed, 3 Aug 2022 17:55:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 033D85B07B; Wed, 3 Aug 2022 14:55:00 -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 96F1A6159C; Wed, 3 Aug 2022 21:54:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3BD42C433C1; Wed, 3 Aug 2022 21:54:58 +0000 (UTC) Date: Wed, 3 Aug 2022 17:54:50 -0400 From: Steven Rostedt To: Linus Torvalds Cc: 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: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Wed, Aug 03, 2022 at 11:57:27AM -0700, Linus Torvalds wrote: > > I really dislike this pattern: > > if (IS_ENABLED(CONFIG_PREEMPT_RT)) > preempt_disable(); > ... > if (IS_ENABLED(CONFIG_PREEMPT_RT)) > preempt_enable(); > > and while the new comment explains *why* it exists, it's still very ugly indeed. > > We have it in a couple of other places, and we also end up having > another variation on the theme that is about "migrate_{dis,en}able()", > except it is written as > > if (IS_ENABLED(CONFIG_PREEMPT_RT)) > migrate_disable(); > else > preempt_disable(); > > because on non-PREEMPT_RT obviously preempt_disable() is the better > and simpler thing. > > Can we please just introduce helper functions? > > At least that > > if (IS_ENABLED(CONFIG_PREEMPT_RT)) > preempt_disable(); > ... > > pattern could be much more naturally expressed as > > preempt_disable_under_spinlock(); > ... > The original patch years ago use to have: preempt_disable_rt() preempt_enable_rt() That did exactly that, but an effort was made to get rid of it. But your more descriptive "preempt_enable/disable_under_spinlock()" may make more sense. -- Steve