linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Replace kmalloc with vmalloc in seq_files
@ 2011-09-22 20:57 Colin Cross
  2011-09-22 20:57 ` [PATCH 1/3] fs: seq_file: add seq_reserve Colin Cross
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Colin Cross @ 2011-09-22 20:57 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-fsdevel, Alexander Viro, Ingo Molnar, Peter Zijlstra,
	Andrew Morton, Alexey Dobriyan, Colin Cross

When a seq_file is implemented with single_open, the show function will
be called with a kmalloc'd PAGE_SIZE buffer.  If the show function
produces more data than can fit in the buffer, the buffer will be thrown
away, and the show function will be called again with a buffer twice as
large.  This process repeats until the show function does not overflow
the buffer, or kmalloc fails.

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.

Since there is no need for a physically contiguous buffer, this patch
set converts the kmalloc'd buffers into vmallocs.  There are two
seq_file users that kmalloc buffer and place it directly into the
seq_file structure, later to be freed by seq_release.  Convert those
to call a new seq_reserve function that will do the correct allocation
for them.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-09-23  0:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-22 20:57 [PATCH 0/3] Replace kmalloc with vmalloc in seq_files Colin Cross
2011-09-22 20:57 ` [PATCH 1/3] fs: seq_file: add seq_reserve Colin Cross
2011-09-22 22:54   ` Alan Cox
2011-09-22 23:24     ` Colin Cross
2011-09-22 20:57 ` [PATCH 2/3] sched_stats: use the new seq_reserve function Colin Cross
2011-09-22 20:57 ` [PATCH 3/3] seq_file: convert seq buffer to vmalloc Colin Cross
2011-09-22 21:07   ` Joe Perches
2011-09-22 21:19     ` Colin Cross
2011-09-22 23:26       ` NamJae Jeon
2011-09-22 21:20     ` Peter Zijlstra
2011-09-22 21:22 ` [PATCH 0/3] Replace kmalloc with vmalloc in seq_files Peter Zijlstra
2011-09-22 21:23 ` Christoph Hellwig
2011-09-23  0:00   ` Colin Cross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).