[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090816163422.a147a918.akpm@linux-foundation.org>
Date: Sun, 16 Aug 2009 16:34:22 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Alan Cox <alan@...rguk.ukuu.org.uk>
Cc: Stefani Seibold <stefani@...bold.net>,
linux-kernel <linux-kernel@...r.kernel.org>,
Arnd Bergmann <arnd@...db.de>,
Andi Kleen <andi@...stfloor.org>,
Amerigo Wang <xiyou.wangcong@...il.com>,
Joe Perches <joe@...ches.com>
Subject: Re: [PATCH 2/7] kfifo: move out spinlock
On Sun, 16 Aug 2009 23:58:43 +0100 Alan Cox <alan@...rguk.ukuu.org.uk> wrote:
> On Sun, 16 Aug 2009 22:46:30 +0200
> Stefani Seibold <stefani@...bold.net> 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
weird.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists