lkml.org 
[lkml]   [2011]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 0/3] Replace kmalloc with vmalloc in seq_files
From
On Thu, Sep 22, 2011 at 2:23 PM, Christoph Hellwig <hch@infradead.org> wrote:
> On Thu, Sep 22, 2011 at 01:57:06PM -0700, Colin Cross wrote:
>> seq_files are often used for debugging data.  When the system is under
>> memory pressure, and dumping debugging data starts trying to allocate
>> large physically contiguous buffers, it often makes the problem worse.
>
> Please fix the instances that you see issues with by using the full
> seq_file interface which was designed for his instead of the simplified
> "single" interface that is only designed for small amounts of data.

You're probably right, but it's not always easy. For files that need
to show an atomic snapshot of some data, the data needs to go
somewhere. It would be possible to allocate a smaller data structure
and atomically copy a snapshot into it, then use the iterator
interface to push the data out to userspace, but that's a lot harder
than a vmalloc and a few seq_printfs.

If seq_file used a list of buffers, it could allocate much smaller
chunks (a page?), and add new buffers to the list instead of
reallocating and calling the read function again.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-09-23 02:03    [W:0.059 / U:0.900 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site