Re: Why add the general notification queue and its sources

From
David Howells <dhowells@redhat.com>
Date
2019-09-06 10:09:26
Also in
keyrings, linux-api, linux-block, linux-fsdevel, linux-usb, lkml
Reply to
Linus Torvalds, 2019-09-06
Linus Torvalds [off-list ref] wrote:
But it's *literally* just finding the places that work with
pipe->curbuf/nrbufs and making them use atomic updates.
No.  It really isn't.  That's two variables that describe the occupied section
of the buffer.  Unless you have something like a 68020 with CAS2, or put them
next to each other so you can use CMPXCHG8, you can't do that.

They need converting to head/tail pointers first.
They really would work with almost anything. You could even mix-and-match
"data generated by kernel" and "data done by 'write()' or 'splice()' by a
user process".
Imagine that userspace writes a large message and takes the mutex.  At the
same time something in softirq context decides *it* wants to write a message -
it can't take the mutex and it can't wait, so the userspace write would have
to cause the kernel message to be dropped.

What I would have to do is make a write to a notification pipe go through
post_notification() and limit the size to the maximum for a single message.

Much easier to simply suppress writes and splices on pipes that have been set
up to be notification queues - at least for now.

David
Thread (35 messages) 35 messages, 8 authors, last reply 2019-09-06
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help