From: Peter Hurley <peter@hurleysoftware.com>
To: Sven Brauch <mail@svenbrauch.de>,
Oliver Neukum <oneukum@suse.com>, Johan Hovold <johan@kernel.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>,
Toby Gray <toby.gray@realvnc.com>,
linux-usb@vger.kernel.org, linux-serial@vger.kernel.org
Subject: Re: [PATCH] Fix data loss in cdc-acm
Date: Tue, 20 Oct 2015 14:16:20 -0400 [thread overview]
Message-ID: <562684F4.1020501@hurleysoftware.com> (raw)
In-Reply-To: <55C249A3.6030809@hurleysoftware.com>
On 08/05/2015 01:36 PM, Peter Hurley wrote:
> On 07/22/2015 06:53 PM, Sven Brauch wrote:
>> On 23/07/15 00:12, Peter Hurley wrote:
>>> The premature unthrottle actually leads to the data loss but the throttling
>>> with a mere 2K left is _way too late_.
>> Ok, yes, I think so too.
>>
>>> 10ms is a _really_ long time for a cpu not to attend to a kworker.
>
> I haven't forgotten about this problem and I still plan to look into why
> the long delay, particularly focusing on the scheduling latency from
> tty_flip_buffer_push() => flush_to_ldisc().
I made some changes wrt which CPU is scheduled for the flush_to_ldisc()
input worker, which should reduce the kworker latency. The changes are
on the tty-next branch of Greg's tty.git tree; please test at your earliest
convenience.
>>> 1. What are the termios settings of the tty receiving input? Is it 'raw'
>>> mode or typical terminal mode (icanon, echo, etc.) or something else?
>> In my test code, I open the tty like
>> fd = open("/dev/ttyACM0", O_RDWR | O_NOCTTY | O_NONBLOCK);
>> I don't make any other changes to the default settings. To be honest,
>> I'm not sure in which mode it is operating then (I was assuming raw, but
>> I might be wrong?).
ECHO is on by default and the cdc-acm driver does not implement the
put_char() and flush_chars() tty driver methods, which made the problem
_way worse_, since every echoed char is sent as it's own URB.
Since echoing is performed by the input worker, this seems the likely
cause for the significant delay in ldisc processing.
Echo processing should probably be performed by a separate kworker rather
than by the input kworker.
Regards,
Peter Hurley
next prev parent reply other threads:[~2015-10-20 18:16 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-19 21:37 [PATCH] Fix data loss in cdc-acm Sven Brauch
2015-07-20 17:25 ` Johan Hovold
2015-07-20 18:07 ` Sven Brauch
2015-07-21 9:18 ` Johan Hovold
2015-07-21 16:45 ` Peter Hurley
2015-07-22 8:40 ` Oliver Neukum
2015-07-22 14:30 ` Peter Hurley
2015-07-22 15:01 ` Oliver Neukum
2015-08-05 0:26 ` Peter Hurley
2015-07-21 13:43 ` Oliver Neukum
2015-07-21 21:43 ` Sven Brauch
2015-07-21 23:34 ` Peter Hurley
2015-07-22 0:47 ` Sven Brauch
2015-07-22 22:12 ` Peter Hurley
2015-07-22 22:53 ` Sven Brauch
2015-07-27 10:00 ` Peter Stuge
2015-08-05 17:36 ` Peter Hurley
2015-10-20 18:16 ` Peter Hurley [this message]
2015-10-21 10:12 ` Oliver Neukum
2015-10-21 12:09 ` Peter Hurley
2015-10-21 14:58 ` Peter Hurley
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=562684F4.1020501@hurleysoftware.com \
--to=peter@hurleysoftware.com \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=johan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mail@svenbrauch.de \
--cc=oneukum@suse.com \
--cc=toby.gray@realvnc.com \
/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;
as well as URLs for NNTP newsgroup(s).