lkml.org 
[lkml]   [2014]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V2 1/2] ftrace: Make saved_cmdlines use seq_read
On Thu, 20 Feb 2014 17:44:31 +0900
Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com> 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


\
 
 \ /
  Last update: 2014-05-30 05:41    [W:0.126 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site