Re: [PATCH v13 3/3]: perf record: extend trace writing to multi AIO

From: Namhyung Kim
Date: Fri Oct 12 2018 - 05:49:05 EST


Hi,

On Thu, Oct 11, 2018 at 09:59:19PM +0300, Alexey Budankov wrote:
>
> Multi AIO trace writing allows caching more kernel data into userspace
> memory postponing trace writing for the sake of overall profiling data
> thruput increase. It could be seen as kernel data buffer extension into
> userspace memory.
>
> With aio option value different from 0, default value is 1,
> tool has capability to cache more and more data into user space
> along with delegating spill to AIO.
>
> That allows avoiding suspend at record__aio_sync() between calls of
> record__mmap_read_evlist() and increase profiling data thruput for
> the cost of userspace memory.
>
> Signed-off-by: Alexey Budankov <alexey.budankov@xxxxxxxxxxxxxxx>
> ---
> Changes in v13:
> - preserved --aio option name avoiding complication
> Changes in v12:
> - extended --aio option to --aio-cblocks=<n>
> Changes in v10:
> - added description of aio-cblocks option into perf-record.txt
> ---

[SNIP]
> @@ -1882,8 +1913,8 @@ static struct option __record_options[] = {
> OPT_BOOLEAN(0, "dry-run", &dry_run,
> "Parse options then exit"),
> #ifdef HAVE_AIO_SUPPORT
> - OPT_CALLBACK_NOOPT(0, "aio", &record.opts,
> - NULL, "Enable asynchronous trace writing mode",
> + OPT_CALLBACK(0, "aio", &record.opts,
> + "n", "Use <n> control blocks in asynchronous trace writing mode (default: 1, max: 4)",

One question. It seems you used a very large N in your test result.
Why did you limit it to 4 here? Is it something different? Maybe
you'd better making it a macro constant for future changes..

Otherwise looks good to me. For the 3 patches

Acked-by: Namhyung Kim <namhyung@xxxxxxxxxx>

Thanks,
Namhyung



> record__aio_parse),
> #endif
> OPT_END()
> @@ -2078,6 +2109,8 @@ int cmd_record(int argc, const char **argv)
> goto out;
> }
>
> + if (rec->opts.nr_cblocks > 4)
> + rec->opts.nr_cblocks = 4;
> if (verbose > 0)
> pr_info("nr_cblocks: %d\n", rec->opts.nr_cblocks);