Re: [PATCH V6 04/16] rv/include: Add deterministic automata monitor definition via C macros
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: [PATCH V6 04/16] rv/include: Add deterministic automata monitor definition via C macros
- From: Daniel Bristot de Oliveira <bristot@xxxxxxxxxx>
- Date: Thu, 21 Jul 2022 14:08:38 +0200
- Cc: 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>, Tao Zhou <tao.zhou@xxxxxxxxx>, Randy Dunlap <rdunlap@xxxxxxxxxxxxx>, linux-doc@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-trace-devel@xxxxxxxxxxxxxxx
- In-reply-to: <20220720160606.3e672b55@gandalf.local.home>
- References: <cover.1658244826.git.bristot@kernel.org> <9ffc05b67fff087413143a420373731e0e34eef4.1658244826.git.bristot@kernel.org> <20220720160606.3e672b55@gandalf.local.home>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0
On 7/20/22 22:06, Steven Rostedt wrote:
>> +/* \
>> + * da_monitor_enabled_##name - checks if the monitor is enabled \
>> + */ \
>> +static inline bool da_monitor_enabled_##name(void) \
>> +{ \
> Should we add a:
>
> smp_rmb();
>
> here? And then a smp_wmb() where these switches get updated?
>
Makes sense.
Should I also add the READ_ONCE/WRITE_ONCE? like
smp_rmb()
READ_ONCE(var)
WRITE_ONCE(var, value)
smp_wmb()
for all these on/off knobs, or just the barriers?
> I guess how critical is it that these turn off immediately after the switch
> is flipped?
It is not critical to continue the execution of those that have already crossed by
the variable. Still, waiting for the tracepoints to finish their execution before
returning to the user-space task that disabled the variable might be a good thing.
IIRC, we can do that via RCU... like, synchronize_rcu()?
>> + /* global switch */ \
>> + if (unlikely(!rv_monitoring_on())) \
>> + return 0; \
>> + \
>> + /* monitor enabled */ \
>> + if (unlikely(!rv_##name.enabled)) \
>> + return 0; \
>> + \
>> + return 1; \
>> +} \
>> + \
[Index of Archives]
[Linux USB Development]
[Linux USB Development]
[Linux Audio Users]
[Yosemite Hiking]
[Linux Kernel]
[Linux SCSI]