[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1316725029-22737-1-git-send-email-ccross@android.com>
Date: Thu, 22 Sep 2011 13:57:06 -0700
From: Colin Cross <ccross@...roid.com>
To: linux-kernel@...r.kernel.org
Cc: linux-fsdevel@...r.kernel.org,
Alexander Viro <viro@...iv.linux.org.uk>,
Ingo Molnar <mingo@...e.hu>,
Peter Zijlstra <peterz@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Alexey Dobriyan <adobriyan@...il.com>,
Colin Cross <ccross@...roid.com>
Subject: [PATCH 0/3] Replace kmalloc with vmalloc in seq_files
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists