<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/tty, branch v2.6.39-rc2</title>
<subtitle>Linux Kernel (branches are rebased on master from time to time)</subtitle>
<id>https://sre.ring0.de/linux/atom?h=v2.6.39-rc2</id>
<link rel='self' href='https://sre.ring0.de/linux/atom?h=v2.6.39-rc2'/>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/'/>
<updated>2011-04-04T21:26:54Z</updated>
<entry>
<title>tty: fix endless work loop when the buffer fills up</title>
<updated>2011-04-04T21:26:54Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-04-04T21:26:54Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=a5660b41af6a28f8004e70eb261e1202ad55c5e3'/>
<id>urn:sha1:a5660b41af6a28f8004e70eb261e1202ad55c5e3</id>
<content type='text'>
Commit f23eb2b2b285 ('tty: stop using "delayed_work" in the tty layer')
ended up causing hung machines on UP with no preemption, because the
work routine to flip the buffer data to the ldisc would endlessly re-arm
itself if the destination buffer had filled up.

With the delayed work, that only caused a timer-driving polling of the
tty state every timer tick, but without the delay we just ended up with
basically a busy loop instead.

Stop the insane polling, and instead make the code that opens up the
receive room re-schedule the buffer flip work.  That's what we should
have been doing anyway.

This same "poll for tty room" issue is almost certainly also the cause
of excessive kworker activity when idle reported by Dave Jones, who also
reported "flush_to_ldisc executing 2500 times a second" back in Nov 2010:

  http://lkml.org/lkml/2010/11/30/592

which is that silly flushing done every timer tick.  Wasting both power
and CPU for no good reason.

Reported-and-tested-by: Alexander Beregalov &lt;a.beregalov@gmail.com&gt;
Reported-and-tested-by: Sitsofe Wheeler &lt;sitsofe@yahoo.com&gt;
Cc: Greg KH &lt;gregkh@suse.de&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Cc: Dave Jones &lt;davej@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>apbuart: Depend upon sparc.</title>
<updated>2011-03-31T04:12:24Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2011-03-31T04:11:35Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=6cd7a63756a68ad5e718b42aa108e27c19425743'/>
<id>urn:sha1:6cd7a63756a68ad5e718b42aa108e27c19425743</id>
<content type='text'>
It absolutely needs to be able to get at pdev_archdata members
which are sparc specific.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Reported-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
</content>
</entry>
<entry>
<title>sparc32,leon: Fixed APBUART frequency detection</title>
<updated>2011-03-30T11:28:54Z</updated>
<author>
<name>Daniel Hellstrom</name>
<email>daniel@gaisler.com</email>
</author>
<published>2011-03-30T01:12:41Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=c897dcf6311ea9c8d24e96cc7f7fe9de58a0a6a2'/>
<id>urn:sha1:c897dcf6311ea9c8d24e96cc7f7fe9de58a0a6a2</id>
<content type='text'>
The UARTs may be located on different APB buses, thus have

different UART clock frequency. The system frequency is not
the same (but often) as the UART frequency, rather the APB bus
frequency that the APBUART is located at has the same
frequency, so this looks at the "freq" property instead.

Signed-off-by: Daniel Hellstrom &lt;daniel@gaisler.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sparc32, leon: APBUART driver must use archdata to get IRQ number</title>
<updated>2011-03-30T11:28:54Z</updated>
<author>
<name>Daniel Hellstrom</name>
<email>daniel@gaisler.com</email>
</author>
<published>2011-03-30T01:12:40Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=10544f128c338aeb7f63c002ad7eee67aa0e6acf'/>
<id>urn:sha1:10544f128c338aeb7f63c002ad7eee67aa0e6acf</id>
<content type='text'>
See Commit id 1636f8ac2b08410df4766449f7c86b912443cd99 (sparc/of:
Move of_device fields into struct pdev_archdata), this patch
is similar to 19e4875fb21a69fbf620e84769a74d189c69c58d (of/sparc:
fix build regression from of_device changes)

Signed-off-by: Daniel Hellstrom &lt;daniel@gaisler.com&gt;
Acked-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>drivers: Final irq namespace conversion</title>
<updated>2011-03-29T12:48:19Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2011-03-28T15:49:12Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=dced35aeb0367dda2636ee9ee914bda14510dcc9'/>
<id>urn:sha1:dced35aeb0367dda2636ee9ee914bda14510dcc9</id>
<content type='text'>
Scripted with coccinelle.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb</title>
<updated>2011-03-26T04:04:56Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-03-26T04:04:56Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=95e14ed7fc4b2db62eb597a70850a0fede48b78a'/>
<id>urn:sha1:95e14ed7fc4b2db62eb597a70850a0fede48b78a</id>
<content type='text'>
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb:
  kdb: add usage string of 'per_cpu' command
  kgdb,x86_64: fix compile warning found with sparse
  kdb: code cleanup to use macro instead of value
  kgdboc,kgdbts: strlen() doesn't count the terminator
</content>
</entry>
<entry>
<title>kgdboc,kgdbts: strlen() doesn't count the terminator</title>
<updated>2011-03-25T21:37:30Z</updated>
<author>
<name>Dan Carpenter</name>
<email>error27@gmail.com</email>
</author>
<published>2010-03-15T12:28:00Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=adb4b83c12f9d966ea3478aa14c60511467c9916'/>
<id>urn:sha1:adb4b83c12f9d966ea3478aa14c60511467c9916</id>
<content type='text'>
This is an off by one because strlen() doesn't count the null
terminator.  We strcpy() these strings into an array of size
MAX_CONFIG_LEN.

Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Signed-off-by: Jason Wessel &lt;jason.wessel@windriver.com&gt;
</content>
</entry>
<entry>
<title>lib, arch: add filter argument to show_mem and fix private implementations</title>
<updated>2011-03-25T00:49:37Z</updated>
<author>
<name>David Rientjes</name>
<email>rientjes@google.com</email>
</author>
<published>2011-03-24T22:18:15Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=b2b755b5f10eb32fbdc73a9907c07006b17f714b'/>
<id>urn:sha1:b2b755b5f10eb32fbdc73a9907c07006b17f714b</id>
<content type='text'>
Commit ddd588b5dd55 ("oom: suppress nodes that are not allowed from
meminfo on oom kill") moved lib/show_mem.o out of lib/lib.a, which
resulted in build warnings on all architectures that implement their own
versions of show_mem():

	lib/lib.a(show_mem.o): In function `show_mem':
	show_mem.c:(.text+0x1f4): multiple definition of `show_mem'
	arch/sparc/mm/built-in.o:(.text+0xd70): first defined here

The fix is to remove __show_mem() and add its argument to show_mem() in
all implementations to prevent this breakage.

Architectures that implement their own show_mem() actually don't do
anything with the argument yet, but they could be made to filter nodes
that aren't allowed in the current context in the future just like the
generic implementation.

Reported-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Reported-by: James Bottomley &lt;James.Bottomley@hansenpartnership.com&gt;
Suggested-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: David Rientjes &lt;rientjes@google.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>drivers/tty/bfin_jtag_comm.c: avoid calling put_tty_driver on NULL</title>
<updated>2011-03-24T02:46:39Z</updated>
<author>
<name>Julia Lawall</name>
<email>julia@diku.dk</email>
</author>
<published>2011-03-23T23:42:56Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=d9d691f584bd012d235c35279c043a2ccd23d7d7'/>
<id>urn:sha1:d9d691f584bd012d235c35279c043a2ccd23d7d7</id>
<content type='text'>
put_tty_driver calls tty_driver_kref_put on its argument, and then
tty_driver_kref_put calls kref_put on the address of a field of this
argument.  kref_put checks for NULL, but in this case the field is likely
to have some offset and so the result of taking its address will not be
NULL.  Labels are added to be able to skip over the call to put_tty_driver
when the argument will be NULL.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// &lt;smpl&gt;
@@
expression *x;
@@

*if (x == NULL)
{ ...
* put_tty_driver(x);
  ...
  return ...;
}
// &lt;/smpl&gt;

Signed-off-by: Julia Lawall &lt;julia@diku.dk&gt;
Cc: Torben Hohn &lt;torbenh@gmx.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>tty: stop using "delayed_work" in the tty layer</title>
<updated>2011-03-22T23:17:32Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-03-22T23:17:32Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=f23eb2b2b28547fc70df82dd5049eb39bec5ba12'/>
<id>urn:sha1:f23eb2b2b28547fc70df82dd5049eb39bec5ba12</id>
<content type='text'>
Using delayed-work for tty flip buffers ends up causing us to wait for
the next tick to complete some actions.  That's usually not all that
noticeable, but for certain latency-critical workloads it ends up being
totally unacceptable.

As an extreme case of this, passing a token back-and-forth over a pty
will take two ticks per iteration, so even just a thousand iterations
will take 8 seconds assuming a common 250Hz configuration.

Avoiding the whole delayed work issue brings that ping-pong test-case
down to 0.009s on my machine.

In more practical terms, this latency has been a performance problem for
things like dive computer simulators (simulating the serial interface
using the ptys) and for other environments (Alan mentions a CP/M emulator).

Reported-by: Jef Driesen &lt;jefdriesen@telenet.be&gt;
Acked-by: Greg KH &lt;gregkh@suse.de&gt;
Acked-by: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
