From: Stefani Seibold <stefani@seibold.net>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Arnd Bergmann <arnd@arndb.de>, Andi Kleen <andi@firstfloor.org>,
Amerigo Wang <xiyou.wangcong@gmail.com>,
Joe Perches <joe@perches.com>
Subject: Re: [PATCH 2/7] kfifo: move out spinlock
Date: Mon, 17 Aug 2009 10:28:56 +0200 [thread overview]
Message-ID: <1250497736.20837.39.camel@wall-e> (raw)
In-Reply-To: <20090817091524.33f99737@lxorguk.ukuu.org.uk>
Am Montag, den 17.08.2009, 09:15 +0100 schrieb Alan Cox:
> > > All over the kernel unlocked function versions have a leading _ name.
> > > It's the kernel convention.
> >
> > Thats is not true in every case. Have a look at list.h - That was the
> > pattern i have implemented the new kfifo API.
>
> Of course it isn't true in every case. Show me a *single* kernel
> convention that is. It's also not true in no cases. foo_locked isn't used
> much at all.
>
> > The main reason to do this was to design a cleaner interface. Because
> > there are very few users of this API, i thought it is a good time and
> > chance to do this.
> >
> > My first draft version does also not renamed this functions, but there
> > was some concerns about the new functionality without modification the
> > function names.
> >
> > Also the remove of the spinlock made is necessary to rename the
> > functions for preventing miss-use by out-of-kernel-tree drivers.
>
> So if you didn't remove the spinlock you wouldn't have to change the API
> and patch all the drivers.
>
No. The kfifo struct in place does made it also necessary to patch all
this drivers.
And the spinlock is in most cases useless, because the API works fine if
only one reader and one writer is using the fifo. This is the common
case.
> > I think the break is not so hard if you believe. All you have to do is
> > to replace or kfifo_get() into kfifo_out_locked() and kfifo_put() into
> > kfifo_in_locked() if you really need the old behavior.
>
> Which is very long winded. If you want longwinded and without breaking
> stuff you can use
>
> foo_unlocked() or unlocked_foo()
>
> which do occur in the kernel (eg ioctl) when we want people to be
> specifically aware of it although according to grep a little less often
> than foo_locked() [discounting foo_is_locked which is general tests]
>
If you like it is very easy to add a compatibility layer, which restores
the old function names. But for what, only for very few users who
depends on it? This will only waste the name space.
next prev parent reply other threads:[~2009-08-17 8:29 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-16 20:39 [PATCH 0/7] kfifo: new API v0.4 Stefani Seibold
2009-08-16 20:44 ` [PATCH 1/7] kfifo: move struct kfifo in place Stefani Seibold
2009-08-16 20:46 ` [PATCH 2/7] kfifo: move out spinlock Stefani Seibold
2009-08-16 22:58 ` Alan Cox
2009-08-16 23:34 ` Andrew Morton
2009-08-17 6:48 ` Alan Cox
2009-08-17 7:36 ` Andrew Morton
2009-08-17 8:08 ` Alan Cox
2009-08-17 8:14 ` Stefani Seibold
2009-08-17 8:21 ` Andrew Morton
2009-08-17 8:48 ` Alan Cox
2009-08-17 9:22 ` Stefani Seibold
2009-08-17 7:46 ` Stefani Seibold
2009-08-17 8:15 ` Alan Cox
2009-08-17 8:28 ` Stefani Seibold [this message]
2009-08-17 8:53 ` Alan Cox
2009-08-17 9:26 ` Stefani Seibold
2009-08-17 9:51 ` Alan Cox
2009-08-17 9:52 ` Andi Kleen
2009-08-17 9:56 ` Stefani Seibold
2009-08-16 20:50 ` [PATCH 3/7] kfifo: cleanup namespace Stefani Seibold
2009-08-16 20:53 ` [PATCH 4/7] kfifo: rename kfifo_put... into kfifo_in... and kfifo_get... into kfifo_out Stefani Seibold
2009-08-16 20:57 ` [PATCH 5/7] kfifo: add DEFINE_KFIFO and friends, add very tiny functions Stefani Seibold
2009-08-16 21:00 ` [PATCH 6/7] kfifo: add kfifo_skip, kfifo_from_user and kfifo_to_user Stefani Seibold
2009-08-16 21:03 ` [PATCH 0/7] kfifo: add record handling functions Stefani Seibold
2009-08-16 21:04 ` [PATCH 7/7] " Stefani Seibold
2009-08-16 21:08 ` [PATCH 0/7] kfifo: new API v0.4 Stefani Seibold
-- strict thread matches above, loose matches on Subject: below --
2009-08-19 20:49 [PATCH 0/7] kfifo: new API v0.5 Stefani Seibold
2009-08-19 20:53 ` [PATCH 2/7] kfifo: move out spinlock Stefani Seibold
2009-11-16 11:50 [PATCH 0/7] kfifo: new API v0.6 Stefani Seibold
2009-11-16 11:58 ` [PATCH 2/7] kfifo: move out spinlock Stefani Seibold
2009-11-17 11:44 ` Roger Quadros
2009-11-20 8:15 [PATCH 0/7] kfifo: new API v0.7 Stefani Seibold
2009-11-20 8:20 ` [PATCH 2/7] kfifo: move out spinlock Stefani Seibold
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=1250497736.20837.39.camel@wall-e \
--to=stefani@seibold.net \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=andi@firstfloor.org \
--cc=arnd@arndb.de \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xiyou.wangcong@gmail.com \
/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