From: Stefani Seibold <stefani@seibold.net>
To: Andi Kleen <andi@firstfloor.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [RFC 0/2] new kfifo API
Date: Mon, 03 Aug 2009 20:48:41 +0200 [thread overview]
Message-ID: <1249325321.3800.15.camel@wall-e> (raw)
In-Reply-To: <87skg8u51n.fsf@basil.nowhere.org>
Am Montag, den 03.08.2009, 20:27 +0200 schrieb Andi Kleen:
> 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.
>
Yes, it is. If you have only one reader and one writer there is no
locking necessary.
> 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.
>
You can use a global variable for your fifo if you like. Or you can
greate a fifo inside a bootmem object. Which this API you have the
freedom of choice ;-)
> -Andi
>
Stefani
next prev parent reply other threads:[~2009-08-03 18:48 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-03 13:39 [RFC 0/2] new kfifo API Stefani Seibold
2009-08-03 14:42 ` Arnd Bergmann
2009-08-03 15:14 ` Stefani Seibold
2009-08-03 18:23 ` Arnd Bergmann
2009-08-03 18:45 ` Stefani Seibold
2009-08-03 16:41 ` Mike Christie
2009-08-03 18:27 ` Andi Kleen
2009-08-03 18:35 ` Arnd Bergmann
2009-08-03 18:48 ` Stefani Seibold [this message]
2009-08-03 19:00 ` Arnd Bergmann
2009-08-03 19:48 ` Stefani Seibold
2009-08-04 12:24 ` Arnd Bergmann
2009-08-04 12:44 ` Stefani Seibold
2009-08-04 13:45 ` Arnd Bergmann
2009-08-04 14:57 ` Stefani Seibold
2009-08-04 18:00 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1249325321.3800.15.camel@wall-e \
--to=stefani@seibold.net \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox