Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp480870imn; Wed, 27 Jul 2022 11:23:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tzOIbVvLTwMd2WwNDMWKSxLaoult1BrUoXx3RpL1u1aaj/LOC5S+PYCABprsw7vRiS1SAS X-Received: by 2002:a17:902:ab0f:b0:16d:b340:bf8f with SMTP id ik15-20020a170902ab0f00b0016db340bf8fmr3916175plb.140.1658946217688; Wed, 27 Jul 2022 11:23:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658946217; cv=none; d=google.com; s=arc-20160816; b=pSuOHLynIrgAO2NBeuaUfQyT3G1erL9gqt7vu6HewmyvzqfTzkkNSl35Nrp4fWtjA4 myqYzyZlLNo2Y9UfQ0QaZyb0ZuotKWlBCidNcuuBhdrQUzn6eg2Jb52OTg1vBRWFn4oc 5WwXzFwPADhFvLFlPemgQjhTx+JWAlUy6oKfe/ABrmV3yn2wdi00HfC/XNXw44FpI1Gm EO7BcJXzqAleaig94gIoQoyDZdNVnt599lVXWDtF6CUmkVnMnBnySd1WH47ChD/DY116 JTCj4LUGkwjXbjrFsF6xPEZSE03UJWZAo5JBb6CsHyIu25i5lMaJBlb34nQSpnLeFy6n Lnow== 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:dkim-signature:date; bh=vDTc2P3W0cdpqM6y0cdrKPPqHIzlLdGjU1Vo1e/Da/8=; b=Gc+7/Gu9mbMxWAmvwjYntF4kN/RrWh517Sg79zH+iVSrZw6LsvTbEK8zlgKboa7YT1 3ryQpz2Vx9GzUmOS6FUF4fie3y6G4KN9fhQgd0IBoiFJeHZeLMkkP7/rBZhSiRSe/pTR NsWhdbBfSOmSy+esglPtEAKl0qgAAUx6JHU5s6QX7k4MQnXW7c9Lhr0gaZANKV8yzBcy m3KmXf0yd1N5iTTix1uH2iDvzX86m4k0geHdLu9blqov7AF5y6DKfiFubPAgb7l9wMNz SU7bl2YA6JWSuUwxlrVyFQNItOcHqYoUpFTbQBSQDak8U33q/mQOeoQ9ijHsE+WFLQZQ /Uwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=YaH+br3I; 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=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l34-20020a635722000000b0041a5c88e689si21007144pgb.188.2022.07.27.11.23.22; Wed, 27 Jul 2022 11:23:37 -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.dev header.s=key1 header.b=YaH+br3I; 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=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234756AbiG0QK2 (ORCPT + 99 others); Wed, 27 Jul 2022 12:10:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234563AbiG0QK0 (ORCPT ); Wed, 27 Jul 2022 12:10:26 -0400 Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89C44E0DA; Wed, 27 Jul 2022 09:10:25 -0700 (PDT) Date: Thu, 28 Jul 2022 00:10:10 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1658938223; h=from:from:reply-to:subject:subject: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=vDTc2P3W0cdpqM6y0cdrKPPqHIzlLdGjU1Vo1e/Da/8=; b=YaH+br3IhFwvw+NOWW8DYs8wG8Ahb3j41ozaHCskwVDzcCFo00PH3xdZfUUcqB/s6k1pet Oc4bbVysDNsEBRsBdAcSvLR4GJ/e3QOXmbkiTD3OX5wF+Rn2QWB10gIde6YX1cLiUF2jNA zI5l//nodSfPHEOaTR2YicOI+a1f0FY= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Tao Zhou To: Daniel Bristot de Oliveira Cc: Steven Rostedt , 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 , Randy Dunlap , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-devel@vger.kernel.org, Tao Zhou Subject: Re: [PATCH V7 01/16] rv: Add Runtime Verification (RV) interface Message-ID: References: <2aa3b18239f170ba23263f18d166d08634ed65dd.1658778484.git.bristot@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2aa3b18239f170ba23263f18d166d08634ed65dd.1658778484.git.bristot@kernel.org> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, 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 Mon, Jul 25, 2022 at 10:11:13PM +0200, Daniel Bristot de Oliveira wrote: > +void rv_put_task_monitor_slot(int slot) > +{ > + lockdep_assert_held(&rv_interface_lock); > + > + if (slot < 0 || slot >= RV_PER_TASK_MONITORS) { > + WARN_ONCE(1, "RV releasing an invalid slot!: %d\n", slot); > + return; > + } > + > + WARN_ONCE(!task_monitor_slots[slot], "RV releasing unused task_monitor_slots: %d\n", > + slot); > + > + task_monitor_count--; > + task_monitor_slots[slot] = false; > +} I would say this can be implemented using bits. Also is an optimization. But now here just use bool and seems not that needed. > +static void turn_monitoring_off(void) > +{ > + WRITE_ONCE(monitoring_on, false); > + /* monitoring_on */ > + smp_wmb(); Absolutely the sync I can not see. If not store another after smp_wmb(), even you have smp_wmb() pair, it is not valid in my poor mind that there is no another load before loading of monitoring_on that ensure something like if the another load is *what* then the after load is ensured to be *what* statement (I am sure I am poor on these, but just some words input yeah).