Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp5692806imw; Wed, 20 Jul 2022 10:29:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uy1WkBePvQrXLiTXmbbDEGkwlMCocSVJjs8gff4/rDGVPlZJrSMfA9wF95xLSPQ/4z3xob X-Received: by 2002:a62:be04:0:b0:52a:e089:99ee with SMTP id l4-20020a62be04000000b0052ae08999eemr39453216pff.26.1658338172938; Wed, 20 Jul 2022 10:29:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658338172; cv=none; d=google.com; s=arc-20160816; b=jL6YVUm4xfxV44adWgW9Lzt2cRzcJLRThugWEVDhHD2TdxO9eH5iuJkw0nOdIA6OMi A7Cx7Um/WXUneceOTftKrmO4NQTAVn5wxyXnN202LNeQgGsqknMdWxKJ66H1Ub7vk6kr Xto3WsPJ+TdR7IPNj35YcMiN6b2cmWe0dBxnCRQKOhGP3a+uQDMWhndhgenJQiSZv4AM FP1eJiVIeGj/vI1HnB+FXbEr/uC7b0E8oVeGPggenZ/0+uB8Q+7qFiZBReF6wFecqeOR qnps9CCXHgL3G/+icsrxTHjDsOjj3iOOYbjaSfvGIxsZ6kOBVcugagbVlB4zgA77m9d5 uoDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=cslbfm0SH7CH1HSjRQXwhy2VbFYQYP/mbMf9Dc7o93k=; b=Dmf5bl3r6dy3so8TmkXl4OZBfuL9t2VNIbF+VAHxjHjbkJIRJpcpVsPaDYFaRdYJhn aZoKiGHMQOt1Gnd3yaoARn1ThnU+SuKGFsDDz8My30ffG/vjK4A2FNAp3I9B0pt9rGdI 30a40Sov7qfd1GEiz0x+n71cdg+865UCUidGM6xJg77GTa01zbUi0l1KYOyHJUtB8Kgm djz3uzk4Wqyzk6FWNDTGhMvt0TaaV/wD9gf7zdVDwmpul+pqJi+Lf0Xf+abupub5x1Zv 5L68aPSplw02+E0LoG2lZt9p2Z9+jSudaIvuN6H1MtOp8HWD3xnZGWAl2FlpVPbZdF6b MsSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uNkB1dR3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x41-20020a056a0018a900b0051b9771d617si21423443pfh.179.2022.07.20.10.29.18; Wed, 20 Jul 2022 10:29: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=@kernel.org header.s=k20201202 header.b=uNkB1dR3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231483AbiGTQux (ORCPT + 99 others); Wed, 20 Jul 2022 12:50:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229862AbiGTQuw (ORCPT ); Wed, 20 Jul 2022 12:50:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1821866ACF; Wed, 20 Jul 2022 09:50:51 -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 ams.source.kernel.org (Postfix) with ESMTPS id C8439B82152; Wed, 20 Jul 2022 16:50:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8AB7BC3411E; Wed, 20 Jul 2022 16:50:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658335848; bh=99nw1jYbMX7Wt38g13l7SpdSTD6XHu02dXxP8XSMYEI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=uNkB1dR3O/0qAwSMid/mp2RLnfxMVbkagceLMWQkGb/o2wWbkSCxchNEB/1IBAC5M QpQTpHhAtGNzr8EC8rSKYANGJIV03EHZuBSZbruEvGxUDCmkNaWnk3soVZjJFiMJMV ssx73GabwApJPqL3xhqcHB+dkg84m3h25NQXOpmzSpR1fd/XnhEOS/6jxzgjDfT002 tnyJpKKCUdHsLDEl2CC+YR3EjYN7e2cOK1D1CwO9HHPcbUSJOjutJEYYL7GYetlAaz HR2K6rbdLLu6mAE0BOlTnwCMNW5wytLDN2+wroViawZ6o5wPneLTNjbfQ6fxAMhPgo 0BJR0uy2Vk+GQ== Message-ID: Date: Wed, 20 Jul 2022 18:50:39 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH V6 02/16] rv: Add runtime reactors interface Content-Language: en-US To: Steven Rostedt Cc: Wim Van Sebroeck , Guenter Roeck , Jonathan Corbet , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , Will Deacon , Catalin Marinas , Marco Elver , Dmitry Vyukov , "Paul E. McKenney" , Shuah Khan , Gabriele Paoloni , Juri Lelli , Clark Williams , Tao Zhou , Randy Dunlap , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-devel@vger.kernel.org References: <4b5f93e3186b067073c1692d4c2b50d0b42101d5.1658244826.git.bristot@kernel.org> <20220720124133.3cdd2c44@gandalf.local.home> From: Daniel Bristot de Oliveira In-Reply-To: <20220720124133.3cdd2c44@gandalf.local.home> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, 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 7/20/22 18:41, Steven Rostedt wrote: > On Tue, 19 Jul 2022 19:27:07 +0200 > Daniel Bristot de Oliveira wrote: > >> +/* >> + * reacting_on interface. >> + */ >> +static ssize_t reacting_on_read_data(struct file *filp, >> + char __user *user_buf, >> + size_t count, loff_t *ppos) >> +{ >> + char *buff; >> + >> + mutex_lock(&rv_interface_lock); >> + buff = reacting_on ? "1\n" : "0\n"; >> + mutex_unlock(&rv_interface_lock); > Again, no need for the locks, but perhaps just to keep things sane: > > buf = READ_ONCE(reacting_on) ? "1\n" : "0\n"; So, for all files that only read/write a single variable, use READ_ONCE/WRITE_ONCE without locks? (and in all usage of that variable too). -- Daniel > -- Steve >