diff options
author | Alan Cox <alan@linux.intel.com> | 2010-02-18 16:43:47 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-04-01 16:01:35 -0700 |
commit | f0e053b3b4ddba41d6b238f1e8eb57852e13f593 (patch) | |
tree | e2dfa8f16adef5ce38d9dd74f7918b57b5d16344 /include | |
parent | 9cb1043669666d35a3f547b6540d69dc7e4071a8 (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')
-rw-r--r-- | include/linux/tty.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h index 6abfcf5b5887..d96e5882f129 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; |