From: Sergei Organov <osv@javad.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Andrew Morton <akpm@osdl.org>,
gregkh@suse.de, linux-kernel@vger.kernel.org,
linux-usb-devel@lists.sourceforge.net
Subject: Re: [PATCH] Airprime driver improvements to allow full speed EvDO transfers
Date: Thu, 13 Jul 2006 18:17:10 +0400 [thread overview]
Message-ID: <8764i1h9nd.fsf@javad.com> (raw)
In-Reply-To: <1152552683.27368.185.camel@localhost.localdomain> (Alan Cox's message of "Mon, 10 Jul 2006 18:31:23 +0100")
Alan Cox <alan@lxorguk.ukuu.org.uk> writes:
> Ar Llu, 2006-07-10 am 19:54 +0400, ysgrifennodd Sergei Organov:
>> Wow! The code you've quoted seems to be correct! But where did you get
>> it from? The version of flush_to_ldisc() from drivers/char/tty_io.c from
>> 2.17.4 got last Friday from kernel.org does this:
>
>> From HEAD so it should make 2.6.18. Paul fixed this one.
I've tested my driver with 2.6.18-rc1 and can confirm Paul changes
finally fixed this particular problem. However, this fix unveiled
different problem with the current tty buffering code.
The memory amount that could be used by tty buffers is
uncontrolled. I've arranged a test[1] that demonstrates that tty buffers
do indeed grow to the entire size of available memory at some conditions
resulting in kernel starting to kill random processes until the testing
process is killed.
This problem may occur with any tty driver that doesn't stop to insert
data into the tty buffers in throttled state. And yes, there are such
drivers in the tree. Before Paul's changes, the tty just dropped bytes
that aren't accepted by ldisc, so this problem had no chances to arise.
I think that either the amount of memory used by tty buffers should be
limited by a tty variable with a suitable default, or tty buffering
should be changed not to accept data from drivers in throttled state.
Alternatively, tty may rely on drivers not to insert data in the
throttled state, but then it's better to be written in big red letters
in the description of tty buffer interface routines. Though in the 2
latter cases drivers that insert too much data without pushing to ldisc
may cause similar problem. Anyway, you definitely know better what to do
about it.
[1] I have a USB device streaming data on its bulk endpoint. The device
is handled by improved airprime driver (usb-to-tty converter) that could
be found in Greg's patches. The driver attached the device to
/dev/ttyUSB0. The testing application just opened /dev/ttyUSB0 and went
to sleep, i.e., it just didn't read from the resulting fd. At these
conditions the slab memory reported in /proc/meminfo grew linearly in
time until in a few minutes kernel started to kill processes. The
testing process wasn't the first one the kernel killed. It killed X
server and some other applications until eventually it killed the
testing process at which point things returned to normal operation.
--
Sergei.
next prev parent reply other threads:[~2006-07-13 14:17 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-30 5:48 [PATCH] Airprime driver improvements to allow full speed EvDO transfers Andy Gay
2006-06-30 7:10 ` Andrew Morton
2006-06-30 8:52 ` Pete Zaitcev
2006-06-30 16:59 ` Andy Gay
2006-06-30 10:51 ` Sergei Organov
2006-06-30 12:13 ` [linux-usb-devel] " Alan Cox
2006-06-30 12:02 ` Arjan van de Ven
2006-06-30 13:34 ` Alan Cox
2006-06-30 16:35 ` Andy Gay
2006-07-07 17:23 ` Sergei Organov
2006-07-07 20:07 ` Alan Cox
2006-07-10 10:36 ` Sergei Organov
2006-07-10 11:10 ` Alan Cox
2006-07-10 15:54 ` Sergei Organov
2006-07-10 17:31 ` Alan Cox
2006-07-10 17:24 ` Sergei Organov
2006-07-13 14:17 ` Sergei Organov [this message]
2006-07-13 15:40 ` Alan Cox
2006-07-13 18:20 ` Sergei Organov
2006-07-13 19:08 ` Greg KH
2006-07-14 10:13 ` Sergei Organov
2006-06-30 20:04 ` Roland Dreier
2006-06-30 20:13 ` Andy Gay
2006-07-02 18:48 ` Roland Dreier
2006-07-02 20:29 ` Andy Gay
2006-07-02 20:47 ` Roland Dreier
2006-07-03 7:00 ` Jeremy Fitzhardinge
2006-07-03 14:21 ` Andy Gay
2006-07-03 16:28 ` Jeremy Fitzhardinge
2006-07-03 17:00 ` Andy Gay
2006-07-03 17:00 ` Greg KH
2006-07-03 17:55 ` Andy Gay
2006-07-03 18:08 ` Jeremy Fitzhardinge
2006-07-03 18:16 ` Greg KH
2006-07-03 22:43 ` Andy Gay
2006-07-03 15:43 ` [linux-usb-devel] " Ken Brush
2006-07-03 16:19 ` Andy Gay
2006-07-11 18:31 ` Sergei Organov
2006-07-11 18:55 ` Andy Gay
2006-07-12 9:20 ` Sergei Organov
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=8764i1h9nd.fsf@javad.com \
--to=osv@javad.com \
--cc=akpm@osdl.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb-devel@lists.sourceforge.net \
/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