Re: [PATCH V2 1/2] ftrace: Make saved_cmdlines use seq_read

From: Steven Rostedt
Date: Thu May 29 2014 - 23:08:58 EST


On Thu, 20 Feb 2014 17:44:31 +0900
Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@xxxxxxxxxxx> wrote:

> Current tracing_saved_cmdlines_read() implementation is naive;
> simply allocate a big buffer, construct output data on the
> buffer for each read operation, and then copy a portion of
> the buffer to the user space buffer. This can cause a couple of
> issues such as a slow memory allocation, high cpu usage, and a
> corruption of the output data.
>
> To address these issues, make saved_cmdlines use seq_read.

I changed the subject and change log to the following. The patch is
untouched:

tracing: Have saved_cmdlines use the seq_read infrastructure

Current tracing_saved_cmdlines_read() implementation is naive; It
allocates a large buffer, constructs output data to that buffer for
each read operation, and then copies a portion of the buffer to the
user space buffer. This has several issues such as slow memory
allocation, high CPU usage, and even corruption of the output data.

The seq_read infrastructure is made to handle this type of work.
By converting it to use seq_read() the code becomes smaller,
simplified, as well as correct.


-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/