Lines Matching refs:buffer

13 buffer.  User space applications mmap() or read() from the relay files
21 buffer data. The relay interface doesn't implement any form of data
32 Each relay channel has one buffer per CPU, each buffer has one or more
33 sub-buffers. Messages are written to the first sub-buffer until it is
37 sub-buffer, while the kernel continues writing to the next.
39 When notified that a sub-buffer is full, the kernel knows how many
41 message couldn't fit into a sub-buffer. Userspace can use this
44 After copying it, userspace can notify the kernel that a sub-buffer
98 such as buffer-full conditions would still need to be communicated via
108 access to relay channel buffer data. Here are the file operations
111 open() enables user to open an _existing_ channel buffer.
113 mmap() results in channel buffer being mapped into the caller's
117 read() read the contents of a channel buffer. The bytes read are
125 ended before using read() with overwrite mode. Sub-buffer
129 sendfile() transfer data from a channel buffer to an output file
130 descriptor. Sub-buffer padding is automatically removed
134 notified when sub-buffer boundaries are crossed.
136 close() decrements the channel buffer's refcount. When the refcount
138 buffer open, the channel buffer is freed.
147 mounted when user space applications need access to the buffer
193 channel buffers. Each channel buffer will have an associated file
209 create_buf_file() is called once for each per-cpu buffer from
211 to represent the corresponding channel buffer. The callback should
212 return the dentry of the file created to represent the channel buffer.
259 The total size of each per-cpu buffer is calculated by multiplying the
260 number of sub-buffers by the sub-buffer size passed into relay_open().
263 easily implement random-access-on-buffer-boundary schemes, which can
269 though, it's safe to assume that having only 1 sub-buffer is a bad
274 as to allow the creation of a single 'global' buffer instead of the
280 To have relay_open() create a global buffer, the create_buf_file()
283 represent the single buffer. In the case of a global buffer,
287 buffer - but since it is a global buffer, callers should make sure
288 they use the proper locking for such a buffer, either by wrapping
303 cases, one may open a buffer-only channel and then call
319 continuously cycle around the buffer and will never fail, but will
326 whether data is lost from the beginning or the end of a buffer.
329 per-cpu channel buffers, each implemented as a circular buffer
331 the current sub-buffer of the channel's current per-cpu buffer via the
333 the current sub-buffer, because there's no room left for it, the
335 new sub-buffer is about to occur. The client uses this callback to 1)
336 initialize the next sub-buffer if appropriate 2) finalize the previous
337 sub-buffer if appropriate and 3) return a boolean value indicating
338 whether or not to actually move on to the next sub-buffer.
360 If the current buffer is full, i.e. all sub-buffers remain unconsumed,
361 the callback returns 0 to indicate that the buffer switch should not
367 buffer will again invoke the subbuf_start() callback with the same
370 buffer switch can continue.
389 callback always returns 1, causing the buffer switch to occur
399 Header information can be reserved at the beginning of each sub-buffer
403 reserved in each sub-buffer to store the padding count for that
404 sub-buffer. This is filled in for the previous sub-buffer in the
406 sub-buffer is passed into the subbuf_start() callback along with a
407 pointer to the previous sub-buffer, since the padding value isn't
408 known until a sub-buffer is filled. The subbuf_start() callback is
409 also called for the first sub-buffer when the channel is opened, to
411 previous sub-buffer pointer passed into the callback will be NULL, so
413 writing into the previous sub-buffer.
418 Kernel clients write data into the current cpu's channel buffer using
420 function - it uses local_irqsave() to protect the buffer and should be
427 unless the buffer is full and no-overwrite mode is being used, in
431 relay_reserve() is used to reserve a slot in a channel buffer which
433 that need to write directly into a channel buffer without having to
434 stage data in a temporary buffer beforehand. Because the actual write
441 separated from the reserve, relay_reserve() doesn't protect the buffer
451 forces a sub-buffer switch on all the channel buffers, and can be used
461 state without reallocating channel buffer memory or destroying
466 different purposes. buf_mapped() is called whenever a channel buffer