public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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>,
	Arnd Bergmann <arnd@arndb.de>,
	Amerigo Wang <xiyou.wangcong@gmail.com>,
	Joe Perches <joe@perches.com>,
	Roger Quadros <quadros.roger@gmail.com>,
	Greg Kroah-Hartman <gregkh@suse.de>,
	Mauro Carvalho Chehab <mchehab@redhat.com>,
	Shargorodsky Atal <ext-atal.shargorodsky@nokia.com>
Subject: Re: [PATCH] new kqueue API v.08
Date: Sun, 20 Dec 2009 00:25:15 +0100	[thread overview]
Message-ID: <1261265115.26268.11.camel@wall-e> (raw)
In-Reply-To: <20091219113609.GB9321@basil.fritz.box>

Am Samstag, den 19.12.2009, 12:36 +0100 schrieb Andi Kleen:
> I like the basic idea of a type safe FIFO.
> 
> > #define	DYNAMIC
> > #ifdef DYNAMIC
> > static DECLARE_KFIFO_PTR(test[1], int);
> > #else
> > static DECLARE_KFIFO(test[1], int, FIFO_SIZE);
> 
> The [1] looks weird.  Is that really needed and what does it mean?
> The callers below don't seem to use it like an array.

I am a lazy girl. This is only for convenient, because i don't want to
write always kfifo_....(&test...). Using an array of [1] provide the
pointer automaticly. Of course you can also write

static DECLARE_KFIFO(test, int, FIFO_SIZE);

and then call the kfifo macros with the address of the variable.
 
> 
> > I know that this kind of macros are very sophisticated and not easy to
> > maintain. But i have all tested and it works as expected. I analyzed the
> > output of the compiler and for the x86 the code is as good as hand
> > written assembler code.
> 
> Linux has a long tradition of complicated macros in headers, that shouldn't be a 
> problem.
> 

I know, but this are in my opinion the most complicated macros for
linux.

> >  include/linux/kfifo.h | 1107 +++++++++++++++++++++++++++++---------------------
> >  kernel/kfifo.c        |  768 +++++++++++++++++++++++-----------
> >  2 files changed, 1174 insertions(+), 701 deletions(-)
> > 
> > diff -u -N -r -p mmotm.orig/include/linux/kfifo.h mmotm.new/include/linux/kfifo.h
> > --- mmotm.orig/include/linux/kfifo.h	2009-12-19 00:23:12.510334931 +0100
> > +++ mmotm.new/include/linux/kfifo.h	2009-12-19 00:23:04.375307229 +0100
> > @@ -1,8 +1,7 @@
> >  /*
> > - * A generic kernel FIFO implementation.
> > + * A generic kernel fifo implementation
> >   *
> >   * Copyright (C) 2009 Stefani Seibold <stefani@seibold.net>
> > - * Copyright (C) 2004 Stelian Pop <stelian@popies.net>
> 
> You should probably keep the old copyright, even if not much code remains.
> 

No, all previous code has gone. I use the counter fifo technique since
many years, so the basic idea is very old. 
 
> > +#ifdef __KERNEL__
> >  #include <linux/kernel.h>
> >  #include <linux/spinlock.h>
> > +#include <linux/stddef.h>
> > +#include <linux/scatterlist.h>
> > +#else
> > +#include "helper.h"
> > +#endif
> 
> Such ifdefs should not make it into submitted code. Better use more glue
> in the test program.

Will be fixed after review.

> 
> 
> ... didn't review the whole thing at this point ...

Would be great if you can do this.

Stefani



  reply	other threads:[~2009-12-19 23:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-18 23:30 [PATCH] new kqueue API v.08 Stefani Seibold
2009-12-19 11:36 ` Andi Kleen
2009-12-19 23:25   ` Stefani Seibold [this message]
2009-12-20  5:22     ` Willy Tarreau

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=1261265115.26268.11.camel@wall-e \
    --to=stefani@seibold.net \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=arnd@arndb.de \
    --cc=ext-atal.shargorodsky@nokia.com \
    --cc=gregkh@suse.de \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@redhat.com \
    --cc=quadros.roger@gmail.com \
    --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