[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230822215157.35002478c5e2d40b6abf5e8e@kernel.org>
Date: Tue, 22 Aug 2023 21:51:57 +0900
From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org
Subject: Re: [PATCH] tracing: Fix to avoid wakeup loop in splice read of
per-cpu buffer
On Tue, 22 Aug 2023 04:59:37 -0400
Steven Rostedt <rostedt@...dmis.org> wrote:
> On Mon, 21 Aug 2023 23:19:18 +0900
> "Masami Hiramatsu (Google)" <mhiramat@...nel.org> wrote:
>
> > if (!spd.nr_pages) {
> > long wait_index;
> > + size_t nr_pages;
> > + size_t full;
>
> size_t is usually considered "long" (machine word length).
>
> >
> > if (ret)
> > goto out;
> > @@ -8472,7 +8474,15 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos,
> >
> > wait_index = READ_ONCE(iter->wait_index);
> >
> > - ret = wait_on_pipe(iter, iter->tr->buffer_percent);
> > + /* For splice, we have to ensure at least 1 page is filled */
> > + nr_pages = ring_buffer_nr_pages(iter->array_buffer->buffer, iter->cpu_file);
> > + if (nr_pages * iter->tr->buffer_percent < 100) {
> > + full = nr_pages + 99;
> > + do_div(full, nr_pages);
>
> No need for do_div() as full is not 64 bit on 32 bit machines.
>
> That's why the kernel test robot is complaining.
Thanks for the comment. I decided to set full = 1, maybe we don't need to set
the percent to be the page size because full_hit() checks it by the number
of dirty pages. :)
I'm testing a new one.
Thanks,
>
> -- Steve
>
> > + } else
> > + full = iter->tr->buffer_percent;
> > +
> > + ret = wait_on_pipe(iter, full);
--
Masami Hiramatsu (Google) <mhiramat@...nel.org>
Powered by blists - more mailing lists