Re: [PATCH] Relay CPU hotplug support
Tom Zanussi <[email protected]>
| Newsgroups | gmane.linux.kernel.tracing |
|---|---|
| Message-ID | <[email protected]> |
Mathieu Desnoyers writes: > > Now for buf->krefw : > > I wanted to separate the fact that a buffer is held by a reader from the fact > that a buffer is held by a writer. By doing this, we can support the is_global > channels more efficiently : > > for example, if we have 8 CPUs with a is_global channel, what we want is to wait > until the last writer closes the buffer. Only at that point do we want to > finalize the buffer (this is why the finalize and flush work is done in the > function called upon krefw final put). But, we only want to free the buffer once > the last reader released it : this is why the original kref is still there. > Hi Mathieu, I guess I'm missing something, since I don't think cpu hotplug changes the way the global channels are handled much, other than move the is_global flag into the channel and force the global buffer to occupy chan->buf[0], which your patch also does. I don't understand what you mean by being 'held by a writer' - when you're done with the channel and call relay_close(), that finalizes the buffer and decrements the kref; if there are no readers it goes away, if there are it waits until the file is released. In any case, I'm assuming in my comments (following) that for global buffers, relay_open() creates buf[0] and and additionally sets that as the buf for buf[0..NCPUS], which should allow cpu hotplug events to be ignored for the global case. Tom