Thread (4 messages) 4 messages, 2 authors, 2012-10-16

Re: [PATCH-v2] tty: Use raw spin lock to protect RX flip buffer

From: Ivo Sieben <hidden>
Date: 2012-10-16 06:55:41
Also in: linux-serial

Hi,

2012/10/9 Thomas Gleixner [off-list ref]:
__tty_buffer_flush() can call tty_buffer_free() which in turn can call
kfree(), which is a nono on RT with preemption and interrupts
disabled. Enabling CONFIG_DEBUG_ATOMIC_SLEEP and extensive testing
should have told you that.

I did not look at the other places where this lock is used, but I
suspect there is more fallout lurking.

Thanks,

        tglx
OK, this is a big lesson for me to start using the Kernel Hacking
options more in the future, and especially before sending patches to
the mailing list... Sorry for bothering you with a patch that I could
find out myself was incorrect.

After your remarks, I had some more discussion & reviews with a
colleague of mine. And we finally came to the point where we figured
out that this patch actually tries to solve an issue that is not there
at all... All RX flip buffer handling is initiated from the threaded
IRQ handling: filling the buffer, pushing the buffer and in case of
the low_latency handling (always enabled for PREEMP_RT) also the
copying of the buffer to the line discipline. Therefore the spin lock
was only locked/unlocked by the RX irq thread during "normal" read
operation.

So I skrewed up: I thought I had seen measurements that this patch
improved performance, but after reverting this changeset and redoing
the measurements it proves it has no performance impact at all.

I'll abandon this patch
Thank you very much for reviewing

Regards,
Ivo Sieben
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help