[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1351230291.12511.7.camel@wall-e>
Date: Fri, 26 Oct 2012 07:44:51 +0200
From: Stefani Seibold <stefani@...bold.net>
To: Richard Yang <weiyang@...ux.vnet.ibm.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Stephen Rothwell <sfr@...b.auug.org.au>,
linux-next@...r.kernel.org, linux-kernel@...r.kernel.org,
richard -rw- weinberger <richard.weinberger@...il.com>,
Jiri Kosina <jkosina@...e.cz>
Subject: Re: linux-next: build warnings after merge of the akpm tree
Am Freitag, den 26.10.2012, 06:36 +0800 schrieb Richard Yang:
> >
> >And holy cow that code is hard to read :( Why was kfifo_in()
> >implemented as a macro, anyway? AFAICT all its args have a known type,
> >so we could have used a proper C interface, which would have fixed all
> >this nicely.
>
Thats simple for performance reasons, the compiler remove most of the
code during the compile stage, so no runtime checks are necessary. And
it is the only way since C does not provides templates like C++.
> Hmm, move the definition of kfifo_in()/kfifo_out() into the kfifo.c?
>
Don't do it. this will result in a performance degradation. Look at the
disassembled code by each change in code and compare it with the
previous one. I don't believe that you can produce better code.
--
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