aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2010-02-18 11:43:47 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-02 17:43:23 -0500
commitd9661adfb8e53a7647360140af3b92284cbe52d4 (patch)
tree92946118969a8cbd5918ac6b35142f0051aabc4e /drivers/char
parent4165fe4ef7305609a96c7f248cefb9c414d0ede5 (diff)
tty: Keep the default buffering to sub-page units
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 'drivers/char')
-rw-r--r--drivers/char/tty_buffer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/char/tty_buffer.c b/drivers/char/tty_buffer.c
index 66fa4e10d76b..f27c4d6d956e 100644
--- a/drivers/char/tty_buffer.c
+++ b/drivers/char/tty_buffer.c
@@ -247,7 +247,8 @@ int tty_insert_flip_string(struct tty_struct *tty, const unsigned char *chars,
247{ 247{
248 int copied = 0; 248 int copied = 0;
249 do { 249 do {
250 int space = tty_buffer_request_room(tty, size - copied); 250 int goal = min(size - copied, TTY_BUFFER_PAGE);
251 int space = tty_buffer_request_room(tty, goal);
251 struct tty_buffer *tb = tty->buf.tail; 252 struct tty_buffer *tb = tty->buf.tail;
252 /* If there is no space then tb may be NULL */ 253 /* If there is no space then tb may be NULL */
253 if (unlikely(space == 0)) 254 if (unlikely(space == 0))
@@ -283,7 +284,8 @@ int tty_insert_flip_string_flags(struct tty_struct *tty,
283{ 284{
284 int copied = 0; 285 int copied = 0;
285 do { 286 do {
286 int space = tty_buffer_request_room(tty, size - copied); 287 int goal = min(size - copied, TTY_BUFFER_PAGE);
288 int space = tty_buffer_request_room(tty, goal);
287 struct tty_buffer *tb = tty->buf.tail; 289 struct tty_buffer *tb = tty->buf.tail;
288 /* If there is no space then tb may be NULL */ 290 /* If there is no space then tb may be NULL */
289 if (unlikely(space == 0)) 291 if (unlikely(space == 0))