Re: [PATCH V7 01/16] rv: Add Runtime Verification (RV) interface
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: [PATCH V7 01/16] rv: Add Runtime Verification (RV) interface
- From: Tao Zhou <tao.zhou@xxxxxxxxx>
- Date: Thu, 28 Jul 2022 00:10:10 +0800
- Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>, Wim Van Sebroeck <wim@xxxxxxxxxxxxxxxxxx>, Guenter Roeck <linux@xxxxxxxxxxxx>, Jonathan Corbet <corbet@xxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Will Deacon <will@xxxxxxxxxx>, Catalin Marinas <catalin.marinas@xxxxxxx>, Marco Elver <elver@xxxxxxxxxx>, Dmitry Vyukov <dvyukov@xxxxxxxxxx>, "Paul E. McKenney" <paulmck@xxxxxxxxxx>, Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx>, Gabriele Paoloni <gpaoloni@xxxxxxxxxx>, Juri Lelli <juri.lelli@xxxxxxxxxx>, Clark Williams <williams@xxxxxxxxxx>, Randy Dunlap <rdunlap@xxxxxxxxxxxxx>, linux-doc@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-trace-devel@xxxxxxxxxxxxxxx, Tao Zhou <tao.zhou@xxxxxxxxx>
- In-reply-to: <2aa3b18239f170ba23263f18d166d08634ed65dd.1658778484.git.bristot@kernel.org>
- References: <cover.1658778484.git.bristot@kernel.org> <2aa3b18239f170ba23263f18d166d08634ed65dd.1658778484.git.bristot@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).
[Index of Archives]
[Linux USB Development]
[Linux USB Development]
[Linux Audio Users]
[Yosemite Hiking]
[Linux Kernel]
[Linux SCSI]