lkml.org 
[lkml]   [2022]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH V6 04/16] rv/include: Add deterministic automata monitor definition via C macros
From
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; \
>> +} \
>> + \

\
 
 \ /
  Last update: 2022-07-21 14:10    [W:0.064 / U:0.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site