From: Jason Wessel <jason.wessel@windriver.com>
To: greg@kroah.com, alan@lxorguk.ukuu.org.uk
Cc: linux-kernel@vger.kernel.org, Jason Wessel <jason.wessel@windriver.com>
Subject: [PATCH 2/3] usb-serial: regression fix to move sysrq from hot path
Date: Wed, 17 Jun 2009 21:20:08 -0500 [thread overview]
Message-ID: <1245291609-14871-3-git-send-email-jason.wessel@windriver.com> (raw)
In-Reply-To: <1245291609-14871-2-git-send-email-jason.wessel@windriver.com>
A performance regression was introduced by commit:
98fcb5f78165b8a3d93870ad7afd4d9ebbb8b43a
The sysrq handling should only get executed if the attached usb serial
device is acting as a serial system console. A serial system console
has a very low input throughput vs a 3g usb modem which pushes bytes
through the same interface at a high rate.
Entire strings of output can be processed via the tty input when the
device is not a console.
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
drivers/usb/serial/generic.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index 932d624..82b8883 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -425,11 +425,19 @@ static void flush_and_resubmit_read_urb(struct usb_serial_port *port)
goto done;
/* Push data to tty */
- for (i = 0; i < urb->actual_length; i++, ch++) {
- if (!usb_serial_handle_sysrq_char(port, *ch))
- tty_insert_flip_char(tty, *ch, TTY_NORMAL);
+ if (port->console) {
+ for (i = 0; i < urb->actual_length; i++, ch++) {
+ if (!usb_serial_handle_sysrq_char(port, *ch))
+ tty_insert_flip_char(tty, *ch, TTY_NORMAL);
+ }
+ tty_flip_buffer_push(tty);
+ } else if (urb->actual_length) {
+ i = tty_buffer_request_room(tty, urb->actual_length);
+ if (i) {
+ tty_insert_flip_string(tty, urb->transfer_buffer, i);
+ tty_flip_buffer_push(tty);
+ }
}
- tty_flip_buffer_push(tty);
tty_kref_put(tty);
done:
usb_serial_generic_resubmit_read_urb(port, GFP_ATOMIC);
--
1.6.3.1.9.g95405b
next prev parent reply other threads:[~2009-06-18 2:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-18 2:20 [PATCH 0/3] usb console regression fixes - 2.6.31 Jason Wessel
2009-06-18 2:20 ` [PATCH 1/3] usb,console: Fix regression in usb console on kernel boot Jason Wessel
2009-06-18 2:20 ` Jason Wessel [this message]
2009-06-18 2:20 ` [PATCH 3/3] usb-serial: optimize sysrq function calls Jason Wessel
2009-06-18 9:13 ` [PATCH 2/3] usb-serial: regression fix to move sysrq from hot path Alan Cox
2009-06-18 11:48 ` Jason Wessel
2009-06-18 9:11 ` [PATCH 1/3] usb,console: Fix regression in usb console on kernel boot Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1245291609-14871-3-git-send-email-jason.wessel@windriver.com \
--to=jason.wessel@windriver.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®