User: Password:
Subscribe / Log in / New account

Re: [PATCH 2/7] kfifo: move out spinlock

From:  Andrew Morton <>
To:  Alan Cox <>
Subject:  Re: [PATCH 2/7] kfifo: move out spinlock
Date:  Sun, 16 Aug 2009 16:34:22 -0700
Message-ID:  <>
Cc:  Stefani Seibold <>, linux-kernel <>, Arnd Bergmann <>, Andi Kleen <>, Amerigo Wang <>, Joe Perches <>
Archive-link:  Article

On Sun, 16 Aug 2009 23:58:43 +0100 Alan Cox <> wrote:

> On Sun, 16 Aug 2009 22:46:30 +0200
> Stefani Seibold <> wrote:
> > Move the pointer to the spinlock out of struct kfifo. Most
> > users in tree do not actually use a spinlock, so the few
> > exceptions now have to call kfifo_{get,put}_locked, which takes
> > an extra argument to a spinlock.
> NAK this one for the moment
> We are about to set fifo loose through all the USB and some other
> char/serial drivers all of which will use the spinlock facility.

That sounds like a good reason for applying this patch first.

kfifo has no business assuming that the caller wants to use
spin_lock() locking.

If we want to add wrapper helpers around kfifo to reduce code
duplication in callers, and if one of those wrapper helpers provides
spinlock-based locking then fine.

But the happens-to-use-spin_lock functions shouldn't be called
kfifo_get(), because that steals namespace from the unlocked functions,
and makes the naming for the happens-to-use-mutex_lock functions look

(Log in to post comments)

Copyright © 2009, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds