[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240610115658.27623de4@rorschach.local.home>
Date: Mon, 10 Jun 2024 11:56:58 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Petr Pavlu <petr.pavlu@...e.com>
Cc: Masami Hiramatsu <mhiramat@...nel.org>, Mathieu Desnoyers
<mathieu.desnoyers@...icios.com>, linux-trace-kernel@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-rt-users
<linux-rt-users@...r.kernel.org>
Subject: Re: [PATCH 2/2] ring-buffer: Fix a race between readers and resize
checks
On Fri, 7 Jun 2024 10:29:03 +0200
Petr Pavlu <petr.pavlu@...e.com> wrote:
> Another option could be to try traversing the whole list in smaller
> parts and give up the reader_lock in between them. This would need some
> care to make sure that the operation completes, e.g. the code would need
> to bail out if it detects a change on cpu_buffer->pages_read.
I think I like this approach the most. Perhaps even have a counter that
gets incremented everything a new reader page is taken. And if it
detects that, it restarts the check?
To prevent a DOS, we restart 3 times at most, and then just say "the
list is OK" and exit.
So basically, we release the lock within the loop per each sub-buffer,
and then check if the reader touch it when reacquiring the lock.
-- Steve
Powered by blists - more mailing lists