summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2010-02-18 16:43:47 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2010-04-01 15:58:30 -0700
commitd560f99c9aafb9ebe1911541cf30d909819564eb (patch)
tree4a8a3b57137d5866c6c9b6b344f1c762b1bbbcd4 /include/linux
parent0b4d9d6ac1f1d22fb0342305cd1e9bf67307d194 (diff)
tty: Keep the default buffering to sub-page units
commit d9661adfb8e53a7647360140af3b92284cbe52d4 upstream. We allocate during interrupts so while our buffering is normally diced up small anyway on some hardware at speed we can pressure the VM excessively for page pairs. We don't really need big buffers to be linear so don't try so hard. In order to make this work well we will tidy up excess callers to request_room, which cannot itself enforce this break up. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/tty.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h
index f0f43d08d8b8..c396b449f77e 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -68,6 +68,16 @@ struct tty_buffer {
unsigned long data[0];
};
+/*
+ * We default to dicing tty buffer allocations to this many characters
+ * in order to avoid multiple page allocations. We assume tty_buffer itself
+ * is under 256 bytes. See tty_buffer_find for the allocation logic this
+ * must match
+ */
+
+#define TTY_BUFFER_PAGE ((PAGE_SIZE - 256) / 2)
+
+
struct tty_bufhead {
struct delayed_work work;
spinlock_t lock;