[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250304103957.08c79da0@gandalf.local.home>
Date: Tue, 4 Mar 2025 10:39:57 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Tang Yizhou <yizhou.tang@...pee.com>
Cc: tj@...nel.org, jack@...e.cz, brauner@...nel.org, willy@...radead.org,
akpm@...ux-foundation.org, mhiramat@...nel.org, ast@...nel.org,
linux-mm@...ck.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/3] writeback: Let trace_balance_dirty_pages() take
struct dtc as parameter
On Tue, 4 Mar 2025 19:03:16 +0800
Tang Yizhou <yizhou.tang@...pee.com> wrote:
> @@ -664,16 +660,16 @@ TRACE_EVENT(balance_dirty_pages,
> ),
>
> TP_fast_assign(
> - unsigned long freerun = (thresh + bg_thresh) / 2;
> + unsigned long freerun = (dtc->thresh + dtc->bg_thresh) / 2;
> strscpy_pad(__entry->bdi, bdi_dev_name(wb->bdi), 32);
>
> __entry->limit = global_wb_domain.dirty_limit;
> __entry->setpoint = (global_wb_domain.dirty_limit +
> freerun) / 2;
> - __entry->dirty = dirty;
> + __entry->dirty = dtc->dirty;
> __entry->bdi_setpoint = __entry->setpoint *
> - bdi_thresh / (thresh + 1);
> - __entry->bdi_dirty = bdi_dirty;
> + dtc->wb_thresh / (dtc->thresh + 1);
> + __entry->bdi_dirty = dtc->wb_dirty;
> __entry->dirty_ratelimit = KBps(dirty_ratelimit);
> __entry->task_ratelimit = KBps(task_ratelimit);
> __entry->dirtied = dirtied;
I don't know how much of a fast path these tracepoints are in, but instead
of doing the divisions above, why not just save the values in the ring
buffer, and do the divisions in the TP_printk() section, which is done when
the user reads it and not when the code is executing?
-- Steve
Powered by blists - more mailing lists