[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3c0a4cb5-f88f-ec5f-e614-d1e8ceb036c2@kernel.org>
Date: Thu, 21 Jul 2022 14:08:38 +0200
From: Daniel Bristot de Oliveira <bristot@...nel.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Wim Van Sebroeck <wim@...ux-watchdog.org>,
Guenter Roeck <linux@...ck-us.net>,
Jonathan Corbet <corbet@....net>,
Ingo Molnar <mingo@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Will Deacon <will@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
Marco Elver <elver@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
"Paul E. McKenney" <paulmck@...nel.org>,
Shuah Khan <skhan@...uxfoundation.org>,
Gabriele Paoloni <gpaoloni@...hat.com>,
Juri Lelli <juri.lelli@...hat.com>,
Clark Williams <williams@...hat.com>,
Tao Zhou <tao.zhou@...ux.dev>,
Randy Dunlap <rdunlap@...radead.org>,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-trace-devel@...r.kernel.org
Subject: Re: [PATCH V6 04/16] rv/include: Add deterministic automata monitor
definition via C macros
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; \
>> +} \
>> + \
Powered by blists - more mailing lists