Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 253235
b: refs/heads/master
c: 18367c0
h: refs/heads/master
i:
  253233: 5591652
  253231: 4e4bc38
v: v3
  • Loading branch information
Linus Torvalds committed Jun 8, 2011
1 parent 29e3506 commit 775919a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 805c22168da76a65c978017d0fe0d59cd048e995
refs/heads/master: 18367c0ec73671fbfea35f13ae52d39437c53eb5
14 changes: 2 additions & 12 deletions trunk/drivers/tty/tty_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,7 @@ static void flush_to_ldisc(struct work_struct *work)
spin_lock_irqsave(&tty->buf.lock, flags);

if (!test_and_set_bit(TTY_FLUSHING, &tty->flags)) {
struct tty_buffer *head, *tail = tty->buf.tail;
int seen_tail = 0;
struct tty_buffer *head;
while ((head = tty->buf.head) != NULL) {
int count;
char *char_buf;
Expand All @@ -424,15 +423,6 @@ static void flush_to_ldisc(struct work_struct *work)
if (!count) {
if (head->next == NULL)
break;
/*
There's a possibility tty might get new buffer
added during the unlock window below. We could
end up spinning in here forever hogging the CPU
completely. To avoid this let's have a rest each
time we processed the tail buffer.
*/
if (tail == head)
seen_tail = 1;
tty->buf.head = head->next;
tty_buffer_free(tty, head);
continue;
Expand All @@ -442,7 +432,7 @@ static void flush_to_ldisc(struct work_struct *work)
line discipline as we want to empty the queue */
if (test_bit(TTY_FLUSHPENDING, &tty->flags))
break;
if (!tty->receive_room || seen_tail)
if (!tty->receive_room)
break;
if (count > tty->receive_room)
count = tty->receive_room;
Expand Down

0 comments on commit 775919a

Please sign in to comment.