lkml.org 
[lkml]   [2009]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC 0/2] new kfifo API
From
Date
Stefani Seibold <stefani@seibold.net> writes:
> the buffer. No extra indirection is needed to access the fifo buffer.
> - Lockless access: if only one reader and one writer is active on the fifo,
> which is the common use case, there is no additional locking necessary.

Would it also be NMI safe? I've been looking at a new log buffer
for MCE/NMI. One option was the fifo in ftrace, but it seems
so big that it would blow up the machine check code considerably.

There was also an own new fifo that Ying Huang implemented,
but that one wasn't very popular.

This might be indeed an alternative. Requirement is NMI-safeness.

> The API:
> --------
>
> struct kfifo *kfifo_alloc(unsigned long size, gfp_t gfp_mask)
> Dynamically allocates a new fifo and returns the address
> @size: the size of the internal buffer to be allocated.
> @gfp_mask: get_free_pages mask, passed to kmalloc()

For the MCE use case this would need to be able to optionally use
bootmem because the first initialization happens too early.

-Andi

--
ak@linux.intel.com -- Speaking for myself only.


\
 
 \ /
  Last update: 2009-08-03 20:29    [W:0.144 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site