Lines Matching full:buffer
16 buffer. User space applications mmap() or read() from the relay files
24 buffer data. The relay interface doesn't implement any form of data
35 Each relay channel has one buffer per CPU, each buffer has one or more
36 sub-buffers. Messages are written to the first sub-buffer until it is
40 sub-buffer, while the kernel continues writing to the next.
42 When notified that a sub-buffer is full, the kernel knows how many
44 message couldn't fit into a sub-buffer. Userspace can use this
47 After copying it, userspace can notify the kernel that a sub-buffer
101 such as buffer-full conditions would still need to be communicated via
111 access to relay channel buffer data. Here are the file operations
115 open() enables user to open an _existing_ channel buffer.
117 mmap() results in channel buffer being mapped into the caller's
121 read() read the contents of a channel buffer. The bytes read are
129 ended before using read() with overwrite mode. Sub-buffer
133 sendfile() transfer data from a channel buffer to an output file
134 descriptor. Sub-buffer padding is automatically removed
138 notified when sub-buffer boundaries are crossed.
140 close() decrements the channel buffer's refcount. When the refcount
142 buffer open, the channel buffer is freed.
154 mounted when user space applications need access to the buffer
200 channel buffers. Each channel buffer will have an associated file
216 create_buf_file() is called once for each per-cpu buffer from
218 to represent the corresponding channel buffer. The callback should
219 return the dentry of the file created to represent the channel buffer.
266 The total size of each per-cpu buffer is calculated by multiplying the
267 number of sub-buffers by the sub-buffer size passed into relay_open().
270 easily implement random-access-on-buffer-boundary schemes, which can
276 though, it's safe to assume that having only 1 sub-buffer is a bad
281 as to allow the creation of a single 'global' buffer instead of the
287 To have relay_open() create a global buffer, the create_buf_file()
290 represent the single buffer. In the case of a global buffer,
294 buffer - but since it is a global buffer, callers should make sure
295 they use the proper locking for such a buffer, either by wrapping
304 Buffer-only channels
310 cases, one may open a buffer-only channel and then call
326 continuously cycle around the buffer and will never fail, but will
333 whether data is lost from the beginning or the end of a buffer.
336 per-cpu channel buffers, each implemented as a circular buffer
338 the current sub-buffer of the channel's current per-cpu buffer via the
340 the current sub-buffer, because there's no room left for it, the
342 new sub-buffer is about to occur. The client uses this callback to 1)
343 initialize the next sub-buffer if appropriate 2) finalize the previous
344 sub-buffer if appropriate and 3) return a boolean value indicating
345 whether or not to actually move on to the next sub-buffer.
367 If the current buffer is full, i.e. all sub-buffers remain unconsumed,
368 the callback returns 0 to indicate that the buffer switch should not
374 buffer will again invoke the subbuf_start() callback with the same
377 buffer switch can continue.
396 callback always returns 1, causing the buffer switch to occur
406 Header information can be reserved at the beginning of each sub-buffer
410 reserved in each sub-buffer to store the padding count for that
411 sub-buffer. This is filled in for the previous sub-buffer in the
413 sub-buffer is passed into the subbuf_start() callback along with a
414 pointer to the previous sub-buffer, since the padding value isn't
415 known until a sub-buffer is filled. The subbuf_start() callback is
416 also called for the first sub-buffer when the channel is opened, to
418 previous sub-buffer pointer passed into the callback will be NULL, so
420 writing into the previous sub-buffer.
425 Kernel clients write data into the current cpu's channel buffer using
427 function - it uses local_irqsave() to protect the buffer and should be
434 unless the buffer is full and no-overwrite mode is being used, in
438 relay_reserve() is used to reserve a slot in a channel buffer which
440 that need to write directly into a channel buffer without having to
441 stage data in a temporary buffer beforehand. Because the actual write
448 separated from the reserve, relay_reserve() doesn't protect the buffer
458 forces a sub-buffer switch on all the channel buffers, and can be used
468 state without reallocating channel buffer memory or destroying
473 different purposes. buf_mapped() is called whenever a channel buffer