lkml.org 
[lkml]   [2022]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH V7 02/16] rv: Add runtime reactors interface
From
On 7/26/22 18:26, Steven Rostedt wrote:
> On Mon, 25 Jul 2022 22:11:14 +0200
> Daniel Bristot de Oliveira <bristot@kernel.org> wrote:
>
>> +/**
>> + * reactor_cleanup_monitor - cleanup a monitor reference
>> + * @mdef: monitor's definition.
>> + */
>> +void reactor_cleanup_monitor(struct rv_monitor_def *mdef)
>> +{
>> + mdef->rdef->counter--;
>> +}
>> +
>
> Doesn't this require a lock? Also you might want to add a WARN_ONCE() if it
> goes below zero.

reactor_populate_monitor() and reactor_cleanup_monitor() should be called with
lock taken... adding lockdep check.

oops, I was not actually calling it yet. Not a BUG, as we do not unload reactors,
it was BUG on the way to happen :-)

Adding a WARN_ONCE().

-- Daniel

>
> -- Steve

\
 
 \ /
  Last update: 2022-07-26 22:08    [W:0.049 / U:0.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site