Re: [PATCH 2.4] usb serial write fix

From: Pete Zaitcev
Date: Mon Nov 01 2004 - 22:41:40 EST


On Mon, 01 Nov 2004 08:51:08 -0600, Paul Fulghum <paulkf@xxxxxxxxxxxxx> wrote:

Not a bad idea. I must admit that I thought about that, but then I had
concerns about monopolizing keventd, decided to think later about it, and
forgot about the issue.

> +++ b/drivers/usb/serial/usbserial.c 2004-11-01 08:29:07.000000000 -0600
> + if (port->tty != NULL) {
> + int rc;
> + int sent = 0;
> + while (sent < job->len) {
> + rc = __serial_write(port, 0, job->buff + sent, job->len - sent);
> + if ((rc < 0) || signal_pending(current))
> + break;

Why testing for signals? Do you expect any?

> + sent += rc;
> + if ((sent < job->len) && current->need_resched)
> + schedule();

That's the main problem here, isn't it. Serial communications are slow.
Tying up a shared thread just because of this just does not look right.
And in such CPU intensive way, too.

Looking at pl2303 in 2.4, I do not see any difference between its ->write
method and generic_write which would be specific to pl2303. The key
difference is that generic_write participates in the protocol governed by
port->write_busy. So why don't you simply drop pl2303_write?

-- Pete
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/