Re: [PATCH v4 6/9] compiler.h, bug.h: Prevent double error messages with BUILD_BUG{,_ON}

2012-10-30 Thread Daniel Santos
-by: Daniel Santos daniel.san...@pobox.com --- include/linux/bug.h |4 ++-- include/linux/compiler.h |7 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/linux/bug.h b/include/linux/bug.h index 03259d7..da03dc1 100644 --- a/include/linux/bug.h

Re: [PATCH v4 9/9] bug.h: Convert BUILD_BUG{,_ON} to use BUILD_BUG_ON_MSG

2012-10-30 Thread Daniel Santos
reduces source code bloat, but also prevents the possibility of code being changed for one macro and not for the other (which was previously the case for BUILD_BUG and BUILD_BUG_ON). Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/bug.h | 17 +++-- 1 files

Re: [PATCH v4 6/9] compiler.h, bug.h: Prevent double error messages with BUILD_BUG{,_ON}

2012-10-31 Thread Daniel Santos
On 10/31/2012 06:06 AM, Borislav Petkov wrote: On Wed, Oct 31, 2012 at 12:34:45AM -0500, Daniel Santos wrote: Yes, the __build_bug_on_failed message is much more informative. This will only increase with these patches. For example, the line BUILD_BUG_ON(sizeof(*c) != 4); emits this error

[PATCH v5 1/25] compiler-gcc4.h: Correct verion check for __compiletime_error

2012-09-25 Thread Daniel Santos
__attribute__((error(msg))) was introduced in gcc 4.3 (not 4.4) and as I was unable to find any gcc bugs pertaining to it, I'm presuming that it has functioned as advertised since 4.3.0. Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/compiler-gcc4.h |2 +- 1 files

[PATCH v5 2/25] compiler-gcc4.h: Reorder macros based upon gcc ver

2012-09-25 Thread Daniel Santos
This helps to keep the file from getting confusing, removes one duplicate version check and should encourage future editors to put new macros where they belong. Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/compiler-gcc4.h | 20 +++- 1 files changed, 11

[PATCH v5 3/25] compiler-gcc.h: Add gcc-recommended GCC_VERSION macro

2012-09-25 Thread Daniel Santos
3 4 eliminates some of this verbosity, they can still be cleaned up by this. See also: http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/compiler-gcc.h |3 +++ 1 files changed, 3 insertions(+), 0 deletions

[PATCH v5 5/25] compiler{,-gcc4}.h: Remove duplicate macros

2012-09-25 Thread Daniel Santos
with __compiletime_warning(). Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/compiler-gcc4.h |2 -- include/linux/compiler.h |3 --- 2 files changed, 0 insertions(+), 5 deletions(-) diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 7ad60cd..5755e23

[PATCH v5 7/25] compiler{,-gcc4}.h: Introduce __flatten function attribute

2012-09-25 Thread Daniel Santos
and that the inline expansion occurs in exactly one place, thus not leading to unnecissary bloat. However, it also can eliminate some opportunities for optimization should gcc otherwise decide the function its self is a good candidate for inlining. Signed-off-by: Daniel Santos daniel.san...@pobox.com

[PATCH v5 9/25] bug.h: Add BUILD_BUG_ON_NON_CONST macro

2012-09-25 Thread Daniel Santos
on arrays, pointers structs as well as testing those values). Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/bug.h | 48 1 files changed, 48 insertions(+), 0 deletions(-) diff --git a/include/linux/bug.h b/include/linux

[PATCH v5 10/25] bug.h: Add gcc 4.2+ versions of BUILD_BUG_ON_* macros

2012-09-25 Thread Daniel Santos
in the generic rbtree code. Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/bug.h | 36 1 files changed, 36 insertions(+), 0 deletions(-) diff --git a/include/linux/bug.h b/include/linux/bug.h index e30f600..d14c23c 100644 --- a/include

[PATCH v5 11/25] rbtree.h: Generic Red-Black Trees

2012-09-25 Thread Daniel Santos
Add generic red-black tree code to rbtree.h. Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/rbtree.h | 1155 +++- 1 files changed, 1153 insertions(+), 2 deletions(-) diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h

[PATCH v5 12/25] rbtree.h: include kconfig.h

2012-09-25 Thread Daniel Santos
We shouldn't depend upon kernel.h including this for us. However, this also fixes some issues with compiling in userland (coming later). Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/rbtree.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git

[PATCH v5 17/25] kernel-doc: Don't mangle whitespace in Example section

2012-09-25 Thread Daniel Santos
whitespace for Example sections. More accurately, it preserves it for all sections, but removes it later if the section isn't an Example section. Signed-off-by: Daniel Santos daniel.san...@pobox.com --- scripts/kernel-doc |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff

[PATCH v5 19/25] rbtree.h: add doc comments for struct rb_node

2012-09-25 Thread Daniel Santos
Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/rbtree.h | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h index 3ef30b9..f1fbdea 100644 --- a/include/linux/rbtree.h +++ b/include/linux

[PATCH v5 23/25] selftest: Add basic compiler iterator test script

2012-09-25 Thread Daniel Santos
A Gentoo-specific script (to be run by root) to iterate through all installed compilers, execte runtest.sh script and collect the output data. Signed-off-by: Daniel Santos daniel.san...@pobox.com --- tools/testing/selftests/grbtree/user/runtests.sh | 30 ++ 1 files changed

[PATCH v5 24/25] selftest: report generation script for test results

2012-09-25 Thread Daniel Santos
A script that uses sqlite to load test results and generates a report showing differences in performance per compiler used. Signed-off-by: Daniel Santos daniel.san...@pobox.com --- tools/testing/selftests/grbtree/user/gen_report.sh | 118 1 files changed, 118 insertions

[PATCH v5 25/25] rbtree.h: (optional?) Add RB_INSERT_DUPE_RIGHT flag

2012-09-25 Thread Daniel Santos
of a group of nodes with the same key value. However, this behavior may not always be desired and this flag offers the option to choose them to be inserted at the tail of such a group. Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/rbtree.h | 79

[PATCH v5 4/25] compiler-gcc{3,4}.h: Use GCC_VERSION macro

2012-09-25 Thread Daniel Santos
Using GCC_VERSION reduces complexity, is easier to read and is GCC's recommended mechanism for doing version checks. (Just don't ask me why they didn't define it in the first place.) This also makes it easy to merge compiler-gcc{3,4}.h should somebody want to. Signed-off-by: Daniel Santos

[PATCH v5 8/25] bug.h: Make BUILD_BUG_ON generate compile-time error

2012-09-25 Thread Daniel Santos
that you don't have to build the entire kernel to discover that you have a problem, and then enjoy trying to track it down from a link-time error. Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/bug.h | 24 ++-- 1 files changed, 14 insertions(+), 10 deletions

[PATCH v5 6/25] bug.h: Replace __linktime_error with __compiletime_error

2012-09-25 Thread Daniel Santos
Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/bug.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/linux/bug.h b/include/linux/bug.h index aaac4bb..298a916 100644 --- a/include/linux/bug.h +++ b/include/linux/bug.h @@ -73,7 +73,7

[PATCH v5 15/25] kernel-doc: bugfix - multi-line macros

2012-09-25 Thread Daniel Santos
in a blackslash (optionally followed by whitespace), removing the backslash and any whitespace after it prior to appending (just like the C pre-processor would). This fixes a break in kerel-doc introduced by the additions to rbtree.h. Signed-off-by: Daniel Santos daniel.san...@pobox.com

[PATCH v5 13/25] fair.c: Use generic rbtree impl in fair scheduler

2012-09-25 Thread Daniel Santos
Signed-off-by: Daniel Santos daniel.san...@pobox.com --- kernel/sched/fair.c | 75 ++ 1 files changed, 21 insertions(+), 54 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index c099cc6..8feb4ea 100644 --- a/kernel/sched

[PATCH v5 16/25] kernel-doc: bugfix - empty line in Example section

2012-09-25 Thread Daniel Santos
to close a programlisting with a closing tag for a para block. This patch corrects the problem by simply not outputting anything extra when we're dumping pre-formatted text, since the empty line will be rendered correctly anyway. Signed-off-by: Daniel Santos daniel.san...@pobox.com --- scripts/kernel

[PATCH v5 22/25] selftest: Add script to compile run userspace test program

2012-09-25 Thread Daniel Santos
-by: Daniel Santos daniel.san...@pobox.com --- tools/testing/selftests/grbtree/user/runtest.sh | 108 +++ 1 files changed, 108 insertions(+), 0 deletions(-) create mode 100755 tools/testing/selftests/grbtree/user/runtest.sh diff --git a/tools/testing/selftests/grbtree/user

[PATCH v5 21/25] selftest: Add userspace test program.

2012-09-25 Thread Daniel Santos
GRBTEST_USE_AUGMENTED Generation of the resultant executable is also dependent upon the below .config values. DEBUG_RBTREE DEBUG_RBTREE_VALIDATE Signed-off-by: Daniel Santos daniel.san...@pobox.com --- tools/testing/selftests/grbtree/user/Makefile | 66 +++ tools/testing/selftests/grbtree/user

[PATCH v5 20/25] selftest: Add generic tree self-test common code.

2012-09-25 Thread Daniel Santos
the generic code more poorly than its hand-coded counterpart. Signed-off-by: Daniel Santos daniel.san...@pobox.com --- tools/testing/selftests/grbtree/common.c | 957 ++ tools/testing/selftests/grbtree/common.h | 252 2 files changed, 1209 insertions(+), 0

Re: [PATCH v5 0/25] Generic Red-Black Trees (still WIP)

2012-09-25 Thread Daniel Santos
QA === Q: Why did you add BUILD_BUG_ON_NON_CONST() and BUILD_BUG_ON_NON_CONST42()? A: Because BUILD_BUG_ON_NON_CONST42() will crash if it does not result in the answer to life, the universe and everything! By the way, I have a theory before time, God was writing code on some cosmic

Re: [PATCH v5 0/25] Generic Red-Black Trees (still WIP)

2012-09-25 Thread Daniel Santos
Hmm, looks like I've had some type of mailer problem as this message didn't appear on LKML :( I hope this one goes through, but sorry my patches aren't properly grouped. On 09/25/2012 06:24 PM, Daniel Santos wrote: First I want to apologize for not being able to work on this over most

Re: [PATCH v3 2/9] rbtree: add __rb_change_child() helper function

2012-09-26 Thread Daniel Santos
Sorry to resurrect the dead here, but I'm playing catch-up and this looks important. On 08/20/2012 05:17 PM, Andrew Morton wrote: I'm inclined to agree with Peter here - inline is now a vague, pathetic and useless thing. The problem is that the reader just doesn't *know* whether or not the

Please be aware that __always_inline doesn't mean always inline!

2012-09-26 Thread Daniel Santos
I've noticed that there's a lot of misperception about the meaning of the __always_inline, or more specifically, __attribute__((always_inline)), which does not actually cause the function to always be inlined. Rather, it *allows* gcc to inline the function, even when compiling without

Re: Please be aware that __always_inline doesn't mean always inline!

2012-09-26 Thread Daniel Santos
On 09/26/2012 06:50 PM, Andrew Morton wrote: As I mentioned in the other thread, the __always_inline's in fs/namei.c (at least) are doing exactly what we want them to do, so some more investigation is needed here? Yes, definitely. When I did some tests on it (to confirm the behavior) a few

[PATCH v6 0/25] Generic Red-Black Trees

2012-09-27 Thread Daniel Santos
This revised patch set is rebased onto linux-mmotm. I have a new mail provider now, but they seem just as bad as the last, so I'm going to try to split the recpients in half and pray that this goes through. I'm sorry to those of you who have gotten partial patch sets and I hope to get this

[PATCH v6 1/25] compiler-gcc4.h: Correct verion check for __compiletime_error

2012-09-27 Thread Daniel Santos
__attribute__((error(msg))) was introduced in gcc 4.3 (not 4.4) and as I was unable to find any gcc bugs pertaining to it, I'm presuming that it has functioned as advertised since 4.3.0. Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/compiler-gcc4.h |2 +- 1 files

[PATCH v6 2/25] compiler-gcc4.h: Reorder macros based upon gcc ver

2012-09-27 Thread Daniel Santos
This helps to keep the file from getting confusing, removes one duplicate version check and should encourage future editors to put new macros where they belong. Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/compiler-gcc4.h | 20 +++- 1 files changed, 11

[PATCH v6 4/25] compiler-gcc{3,4}.h: Use GCC_VERSION macro

2012-09-27 Thread Daniel Santos
Using GCC_VERSION reduces complexity, is easier to read and is GCC's recommended mechanism for doing version checks. (Just don't ask me why they didn't define it in the first place.) This also makes it easy to merge compiler-gcc{3,4}.h should somebody want to. Signed-off-by: Daniel Santos

[PATCH v6 6/25] bug.h: Replace __linktime_error with __compiletime_error

2012-09-27 Thread Daniel Santos
Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/bug.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/linux/bug.h b/include/linux/bug.h index aaac4bb..298a916 100644 --- a/include/linux/bug.h +++ b/include/linux/bug.h @@ -73,7 +73,7

[PATCH v6 7/25] compiler{,-gcc4}.h: Introduce __flatten function attribute

2012-09-27 Thread Daniel Santos
and that the inline expansion occurs in exactly one place, thus not leading to unnecissary bloat. However, it also can eliminate some opportunities for optimization should gcc otherwise decide the function its self is a good candidate for inlining. Signed-off-by: Daniel Santos daniel.san...@pobox.com

[PATCH v6 5/25] compiler{,-gcc4}.h: Remove duplicate macros

2012-09-27 Thread Daniel Santos
with __compiletime_warning(). Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/compiler-gcc4.h |2 -- include/linux/compiler.h |3 --- 2 files changed, 0 insertions(+), 5 deletions(-) diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index b44307d..ad610f2

[PATCH v6 3/25] compiler-gcc.h: Add gcc-recommended GCC_VERSION macro

2012-09-27 Thread Daniel Santos
3 4 eliminates some of this verbosity, they can still be cleaned up by this. See also: http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/compiler-gcc.h |3 +++ 1 files changed, 3 insertions(+), 0 deletions

email still screwed

2012-09-27 Thread Daniel Santos
well, I guess my new email provider is worse than the old one, as only the summary email appears to have made it through. I'll try something else tomorrow :( Daniel -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More

Re: [PATCH 7/10] compiler{,-gcc4}.h: Introduce __flatten function attribute

2012-10-03 Thread Daniel Santos
On 10/03/2012 02:53 AM, David Rientjes wrote: On Tue, 2 Oct 2012, Josh Triplett wrote: This patch series started out as part of another patch series by Daniel Santos that makes use of __flatten; I think Daniel plans to have that patch series depend on this one. Thus, I think it makes sense

Re: [PATCH 6/10] bug.h: Replace __linktime_error with __compiletime_error

2012-10-03 Thread Daniel Santos
On 10/03/2012 01:44 AM, David Rientjes wrote: On Fri, 28 Sep 2012, Daniel Santos wrote: Signed-off-by: Daniel Santos daniel.san...@pobox.com After this is folded into the previous patch in the series, compiler{,-gcc4}.h: Remove duplicate macros, then: Acked-by: David Rientjes rient

Re: [PATCH 7/10] compiler{,-gcc4}.h: Introduce __flatten function attribute

2012-10-03 Thread Daniel Santos
On 10/03/2012 09:01 AM, Steven Rostedt wrote: On Wed, 2012-10-03 at 06:20 -0500, Daniel Santos wrote: Daniel, please introduce __flatten in the patch series that uses it, thanks. That isn't going to work. I split my patches out into three sets because, otherwise, the list of maintainers

Re: [PATCH v6 0/25] Generic Red-Black Trees

2012-10-03 Thread Daniel Santos
On 10/01/2012 03:47 PM, Andrew Morton wrote: On Mon, 01 Oct 2012 15:41:14 -0500 Daniel Santos danielfsan...@att.net wrote: I can rebase against whatever you like and send either corrections or an updated patch set. Just tell me what works please. I dropped everything - let's start again. I

Re: [PATCH 6/10] bug.h: Replace __linktime_error with __compiletime_error

2012-10-03 Thread Daniel Santos
On 10/03/2012 01:26 PM, David Rientjes wrote: On Wed, 3 Oct 2012, Daniel Santos wrote: Thanks. I've actually just reversed the patch order per Josh's suggestion and added patch comments to it. I can squash them if you guys prefer. No need to be so fine-grained in your patches, if you're

Re: [PATCH 7/10] compiler{,-gcc4}.h: Introduce __flatten function attribute

2012-10-03 Thread Daniel Santos
On 10/03/2012 07:32 PM, Steven Rostedt wrote: On Wed, 2012-10-03 at 08:38 -0700, Joe Perches wrote: On Wed, 2012-10-03 at 11:14 -0400, Steven Rostedt wrote: I first check the MAINTAINERS file. If the subsystem I'm working on exists there, I only email those that are listed there, including

Re: [Bug 48241] New: oops when setting up LVM (3.6.0-next-20121003)

2012-10-04 Thread Daniel Santos
On 10/03/2012 10:23 AM, James Bottomley wrote: On Wed, 2012-10-03 at 15:04 +, bugzilla-dae...@bugzilla.kernel.org wrote: https://bugzilla.kernel.org/show_bug.cgi?id=48241 Summary: oops when setting up LVM Product: IO/Storage Version: 2.5 Kernel

Re: [PATCH v2 07/10] compiler.h, bug.h: Prevent double error messages with BUILD_BUG{,_ON}

2012-10-05 Thread Daniel Santos
On 10/05/2012 03:59 PM, Josh Triplett wrote: On Fri, Oct 05, 2012 at 02:42:46PM -0500, danielfsan...@att.net wrote: --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -296,6 +296,11 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); #endif

Re: [PATCH v2 09/10] bug.h: Add BUILD_BUG_ON_MSG BUILD_BUG_INTERNAL{,2}

2012-10-05 Thread Daniel Santos
you to specify the error message you want emitted as the third parameter. Under the hood, this relies on BUILD_BUG_INTERNAL{,2}, which does the actual work and is pretty-much identical to BUILD_BUG_ON. Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/bug.h | 26

Re: [PATCH v2 01/10] compiler-gcc4.h: Reorder macros based upon gcc ver

2012-10-06 Thread Daniel Santos
On 10/06/2012 12:42 PM, Borislav Petkov wrote: @@ -56,10 +65,3 @@ #define __visible __attribute__((externally_visible)) #endif -#if __GNUC_MINOR__ 0 -#define __compiletime_object_size(obj) __builtin_object_size(obj, 0) -#endif -#if __GNUC_MINOR__ = 3 !defined(__CHECKER__) This last

Re: [PATCH v2 03/10] compiler-gcc{3,4}.h: Use GCC_VERSION macro

2012-10-07 Thread Daniel Santos
place.) This also makes it easy to merge compiler-gcc{,3,4}.h should somebody want to. Signed-off-by: Daniel Santos daniel.san...@pobox.com Acked-by: David Rientjes rient...@google.com --- [ … ] diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 4506d65

Re: [PATCH v2 0/10] Cleanup new features for compiler*.h and bug.h

2012-10-07 Thread Daniel Santos
I just realized that in my patch set header I didn't specify that this version of the patches is based against -mm. However, I did not test against -mm, I rebased them to mainline, merged some conflicts and made some changes and tested there and I'm running that kernel now (that is, with all of

Re: [PATCH v2 03/10] compiler-gcc{3,4}.h: Use GCC_VERSION macro

2012-10-07 Thread Daniel Santos
On 10/07/2012 02:42 PM, Borislav Petkov wrote: On Sun, Oct 07, 2012 at 01:27:58PM -0500, Daniel Santos wrote: Did I miss something again? This error preprocessor function is commented out here? Why? We'll have to ask Andrew. Maybe so he can test on those versions of gcc? commit

Re: [PATCH v4 6/9] compiler.h, bug.h: Prevent double error messages with BUILD_BUG{,_ON}

2012-11-03 Thread Daniel Santos
On 10/31/2012 06:06 AM, Borislav Petkov wrote: Realistically, a single macro could be defined in compiler*.h that encapsulates the entirety of this mechanism and only exposes a black box macro, that will simply expand to something that breaks the build in the most appropriate fashion based

Re: [PATCH v3 04/10] bug.h: directly include linux/compiler.h

2012-10-28 Thread Daniel Santos
includes it directly for clarity and to avoid the possibility of changes in arch/*/include/asm/bug.h being changed or not including linux/compiler.h for some reason. (Later patches will in this set use more macros defined in compiler*.h.) Signed-off-by: Daniel Santos daniel.san...@pobox.com

Re: [PATCH v5 7/9] bug.h: Make BUILD_BUG_ON generate compile-time error

2012-11-13 Thread Daniel Santos
__linktime_error (used in BUILD_BUG_ON). This patch includes it directly for clarity and to avoid the possibility of changes in arch/*/include/asm/bug.h being changed or not including linux/compiler.h for some reason. Signed-off-by: Daniel Santos daniel.san...@pobox.com Acked-by: Borislav Petkov

Where to put test code?

2012-09-19 Thread Daniel Santos
I'm putting the finishing touches on the generic red-black tree test code, but I'm uncertain about where to place it exactly. I haven't finished the test module just yet, but the idea is that the tests can be run in userspace as well as kernelspace to make it easier to test on multiple compilers.

Re: Where to put test code?

2012-09-19 Thread Daniel Santos
Thanks for the response! On 09/19/2012 05:18 PM, Frederic Weisbecker wrote: 2012/9/19 Daniel Santos danielfsan...@att.net: I'm putting the finishing touches on the generic red-black tree test code, but I'm uncertain about where to place it exactly. I haven't finished the test module just yet

Generic Red-Black Trees: preliminary performance results

2012-07-10 Thread Daniel Santos
I've completed some rudimentary test code. It is designed to compile both in user kernel space but only currently compiles in userland. I ran this on 9 different versions of gcc, all on x86_64 with CFLAGS=-O2 -g3 -pipe -march=k8. The below summary data shows the % increase in time consumed

Re: [PATCH 02/13] rbtree: empty nodes have no color

2012-07-10 Thread Daniel Santos
On 07/09/2012 06:35 PM, Michel Lespinasse wrote: Empty nodes have no color. We can make use of this property to simplify the code emitted by the RB_EMPTY_NODE and RB_CLEAR_NODE macros. Also, we can get rid of the rb_init_node function which had been introduced by commit

Re: [PATCH 05/13] rbtree: performance and correctness test

2012-07-11 Thread Daniel Santos
On 07/11/2012 01:14 AM, Michel Lespinasse wrote: On Tue, Jul 10, 2012 at 5:27 AM, Michal Nazarewicz min...@mina86.com wrote: On Tue, 10 Jul 2012 01:35:15 +0200, Michel Lespinasse wal...@google.com wrote: + u32 prev_key = 0; + + for (rb = rb_first(root); rb; rb = rb_next(rb)) {

Re: [PATCH v5 6/9] bug.h: Prevent double evaulation of in BUILD_BUG_ON

2012-11-20 Thread Daniel Santos
On 11/17/2012 08:38 AM, Borislav Petkov wrote: On Thu, Nov 15, 2012 at 01:11:15PM -0600, Daniel Santos wrote: Ah yes. I did notice that at one point, but I think it slipped my mind. Also, the kernel has introduced me to the usage of the !! construct, of which I'm well versed in its affects

Re: [PATCH v7 1/9] compiler-gcc4.h: Reorder macros based upon gcc ver

2013-01-01 Thread Daniel Santos
On 01/01/2013 03:09 PM, danielfsan...@att.net wrote: #ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP -#if __GNUC_MINOR__= 4 +#if GCC_VERSION= 40400 #define __HAVE_BUILTIN_BSWAP32__ #define __HAVE_BUILTIN_BSWAP64__ #endif -#if __GNUC_MINOR__= 8 || (defined(__powerpc__) __GNUC_MINOR__= 6) +#if

Re: [PATCH] utilize _Static_assert() for BUILD_BUG_ON() when the compiler supports it

2012-12-12 Thread Daniel Santos
Wow, it's really easy to miss parallel development on the same issue. Sorry for my late response to this thread. I started another thread addressing these issues (as well as a few others) back in September (https://lkml.org/lkml/2012/9/28/1136). I've finally gotten ACKs from maintainers

Re: [PATCH] utilize _Static_assert() for BUILD_BUG_ON() when the compiler supports it

2012-12-12 Thread Daniel Santos
On 11/06/2012 03:23 AM, Jan Beulich wrote: This sort of logic is normally performed via the include/linux/compiler*.h system. And grep __GNUC include/linux/*.h indicates that we've been pretty successful. Can we do that here too? (eg: suppose the Intel compiler supports

Re: [PATCH] utilize _Static_assert() for BUILD_BUG_ON() when the compiler supports it

2012-12-13 Thread Daniel Santos
On 12/13/2012 03:43 AM, Jan Beulich wrote: On 13.12.12 at 01:29, Daniel Santosdanielfsan...@att.net wrote: Wow, it's really easy to miss parallel development on the same issue. Sorry for my late response to this thread. I started another thread addressing these issues (as well as a few

Re: [PATCH v5 6/9] bug.h: Prevent double evaulation of in BUILD_BUG_ON

2012-11-15 Thread Daniel Santos
. Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/bug.h |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/linux/bug.h b/include/linux/bug.h index 1b2465d..ccd44ce 100644 --- a/include/linux/bug.h +++ b/include/linux/bug.h @@ -58,8

Re: [PATCH v5 8/9] compiler.h, bug.h: Prevent double error messages with BUILD_BUG{,_ON}

2012-11-15 Thread Daniel Santos
conditions, which we should be expecting in an unoptimized build anyway. Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/bug.h |2 +- include/linux/compiler.h |5 + 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/include/linux/bug.h b

Re: [PATCH v5 9/9] bug.h, compiler.h: Introduce compiletime_assert BUILD_BUG_ON_MSG

2012-11-16 Thread Daniel Santos
On 11/13/2012 04:13 PM, danielfsan...@att.net wrote: +#define __compiletime_assert(condition, msg, __func) \ + do {\ + bool __cond = !(condition); \ + extern void

[PATCH 0/10] Cleanup new features for compiler*.h and bug.h

2012-09-28 Thread Daniel Santos
This patch set is a dependency of the generic red-black tree patch set, which I have now split up into three smaller sets. The major aim of this patch set is to cleanup compiler-gcc*.h and improve the manageability of of compiler features at various versions (when they are broken, etc.), and to

[PATCH 1/10] compiler-gcc4.h: correct verion check for __compiletime_error

2012-09-28 Thread Daniel Santos
NOTE: this is has already been comitted to -mm __attribute__((error(msg))) was introduced in gcc 4.3 (not 4.4) and as I was unable to find any gcc bugs pertaining to it, I'm presuming that it has functioned as advertised since 4.3.0. Signed-off-by: Daniel Santos daniel.san...@pobox.com Cc

[PATCH 6/10] bug.h: Replace __linktime_error with __compiletime_error

2012-09-28 Thread Daniel Santos
Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/bug.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/linux/bug.h b/include/linux/bug.h index aaac4bb..298a916 100644 --- a/include/linux/bug.h +++ b/include/linux/bug.h @@ -73,7 +73,7

[PATCH 2/10] compiler-gcc4.h: Reorder macros based upon gcc ver

2012-09-28 Thread Daniel Santos
This helps to keep the file from getting confusing, removes one duplicate version check and should encourage future editors to put new macros where they belong. Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/compiler-gcc4.h | 20 +++- 1 files changed, 11

[PATCH 4/10] compiler-gcc{3,4}.h: Use GCC_VERSION macro

2012-09-28 Thread Daniel Santos
Using GCC_VERSION reduces complexity, is easier to read and is GCC's recommended mechanism for doing version checks. (Just don't ask me why they didn't define it in the first place.) This also makes it easy to merge compiler-gcc{3,4}.h should somebody want to. Signed-off-by: Daniel Santos

[PATCH 5/10] compiler{,-gcc4}.h: Remove duplicate macros

2012-09-28 Thread Daniel Santos
with __compiletime_warning(). Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/compiler-gcc4.h |2 -- include/linux/compiler.h |3 --- 2 files changed, 0 insertions(+), 5 deletions(-) diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index b44307d..ad610f2

[PATCH 7/10] compiler{,-gcc4}.h: Introduce __flatten function attribute

2012-09-28 Thread Daniel Santos
and that the inline expansion occurs in exactly one place, thus not leading to unnecissary bloat. However, it also can eliminate some opportunities for optimization should gcc otherwise decide the function its self is a good candidate for inlining. Signed-off-by: Daniel Santos daniel.san...@pobox.com

[PATCH 8/10] bug.h: Make BUILD_BUG_ON generate compile-time error

2012-09-28 Thread Daniel Santos
that you don't have to build the entire kernel to discover that you have a problem, and then enjoy trying to track it down from a link-time error. Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/bug.h | 24 ++-- 1 files changed, 14 insertions(+), 10 deletions

[PATCH 9/10] bug.h: Add BUILD_BUG_ON_NON_CONST macro

2012-09-28 Thread Daniel Santos
on arrays, pointers structs as well as testing those values). Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/bug.h | 48 1 files changed, 48 insertions(+), 0 deletions(-) diff --git a/include/linux/bug.h b/include/linux

[PATCH 10/10] bug.h: Add gcc 4.2+ versions of BUILD_BUG_ON_* macros

2012-09-28 Thread Daniel Santos
in the generic rbtree code. Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/bug.h | 36 1 files changed, 36 insertions(+), 0 deletions(-) diff --git a/include/linux/bug.h b/include/linux/bug.h index e30f600..d14c23c 100644 --- a/include

[PATCH 3/10] compiler-gcc.h: Add gcc-recommended GCC_VERSION macro

2012-09-28 Thread Daniel Santos
3 4 eliminates some of this verbosity, they can still be cleaned up by this. See also: http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/compiler-gcc.h |3 +++ 1 files changed, 3 insertions(+), 0 deletions

[PATCH 0/3] kernel-doc bug fixes

2012-09-28 Thread Daniel Santos
Fixes breakages exposed by doc-comments used in the generic red-black tree patch set. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the

[PATCH 1/3] kernel-doc: bugfix - multi-line macros

2012-09-28 Thread Daniel Santos
in a blackslash (optionally followed by whitespace), removing the backslash and any whitespace after it prior to appending (just like the C pre-processor would). This fixes a break in kerel-doc introduced by the additions to rbtree.h. Signed-off-by: Daniel Santos daniel.san...@pobox.com

[PATCH 2/3] kernel-doc: bugfix - empty line in Example section

2012-09-28 Thread Daniel Santos
to close a programlisting with a closing tag for a para block. This patch corrects the problem by simply not outputting anything extra when we're dumping pre-formatted text, since the empty line will be rendered correctly anyway. Signed-off-by: Daniel Santos daniel.san...@pobox.com --- scripts/kernel

[PATCH 3/3] kernel-doc: Don't mangle whitespace in Example section

2012-09-28 Thread Daniel Santos
whitespace for Example sections. More accurately, it preserves it for all sections, but removes it later if the section isn't an Example section. Signed-off-by: Daniel Santos daniel.san...@pobox.com --- scripts/kernel-doc |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff

[PATCH v6 0/10] Generic Red-Black Trees

2012-09-28 Thread Daniel Santos
This patch set depends upon the following: * Cleanup new features for compiler*.h and bug.h * kernel-doc bug fixes (for generating docs) Summary === This patch set improves on Andrea Arcangeli's original Red-Black Tree implementation by adding generic search and insert functions with

[PATCH v6 1/10] rbtree.h: Generic Red-Black Trees

2012-09-28 Thread Daniel Santos
Add generic red-black tree code to rbtree.h. Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/rbtree.h | 1125 +++- 1 files changed, 1123 insertions(+), 2 deletions(-) diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h

[PATCH v6 3/10] Generate doc comments for rbtree.h in Kernel-API

2012-09-28 Thread Daniel Santos
Signed-off-by: Daniel Santos daniel.san...@pobox.com --- Documentation/DocBook/kernel-api.tmpl |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/Documentation/DocBook/kernel-api.tmpl b/Documentation/DocBook/kernel-api.tmpl index 00687ee..d270f1e 100644

[PATCH v6 4/10] rbtree.h: Add test validation framework

2012-09-28 Thread Daniel Santos
(high run-time overhead) Finally, the DEBUG_GRBTREE_VALIDATE .config variable will force-enable the RB_VERIFY_INTEGRITY behavior on all trees. Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/rbtree.h | 153 --- lib/Kconfig.debug

[PATCH v6 5/10] rbtree.h: add doc comments for struct rb_node

2012-09-28 Thread Daniel Santos
Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/rbtree.h | 14 ++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h index 5f10915..c815b5e 100644 --- a/include/linux/rbtree.h +++ b/include/linux

[PATCH v6 2/10] rbtree.h: include kconfig.h

2012-09-28 Thread Daniel Santos
We shouldn't depend upon kernel.h including this for us. However, this also fixes some issues with compiling in userland (coming later). Signed-off-by: Daniel Santos daniel.san...@pobox.com --- include/linux/rbtree.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git

[PATCH v6 6/10] selftest: Add generic tree self-test common code.

2012-09-28 Thread Daniel Santos
the generic code more poorly than its hand-coded counterpart. Signed-off-by: Daniel Santos daniel.san...@pobox.com --- tools/testing/selftests/grbtree/common.c | 892 ++ tools/testing/selftests/grbtree/common.h | 293 ++ 2 files changed, 1185 insertions(+), 0

[PATCH v6 8/10] selftest: Add script to compile run userspace test program

2012-09-28 Thread Daniel Santos
0x2 count 0x800 keymask 0xfff logfile runtest.log datafileruntest.out Signed-off-by: Daniel Santos daniel.san...@pobox.com --- tools/testing/selftests/grbtree/user/runtest.sh | 122 +++ 1 files changed, 122 insertions(+), 0 deletions

[PATCH v6 9/10] selftest: Add basic compiler iterator test script

2012-09-28 Thread Daniel Santos
A Gentoo-specific script (to be run by root) to iterate through all installed compilers, execte runtest.sh script and collect the output data. Signed-off-by: Daniel Santos daniel.san...@pobox.com --- tools/testing/selftests/grbtree/user/runtests.sh | 52 ++ 1 files changed

[PATCH v6 7/10] selftest: Add userspace test program.

2012-09-28 Thread Daniel Santos
GRBTEST_UNIQUE_KEYS GRBTEST_INSERT_REPLACES Generation of the resultant executable is also dependent upon the below .config values. DEBUG_GRBTREE DEBUG_GRBTREE_VALIDATE Signed-off-by: Daniel Santos daniel.san...@pobox.com --- tools/testing/selftests/grbtree/user/Makefile | 68 +++ tools/testing/selftests

[PATCH v6 10/10] selftest: report generation script for test results

2012-09-28 Thread Daniel Santos
A script that uses sqlite to load test results and generates a report showing differences in performance per compiler used. Signed-off-by: Daniel Santos daniel.san...@pobox.com --- tools/testing/selftests/grbtree/user/gen_report.sh | 129 1 files changed, 129 insertions

Re: [Bulk] Re: [PATCH 4/10] compiler-gcc{3,4}.h: Use GCC_VERSION macro

2012-09-28 Thread Daniel Santos
On 09/28/2012 07:20 PM, Josh Triplett wrote: On Fri, Sep 28, 2012 at 06:20:05PM -0500, Daniel Santos wrote: --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h @@ -13,11 +13,11 @@ #define __must_check__attribute__((warn_unused_result)) #define

Re: [Bulk] Re: [PATCH 5/10] compiler{,-gcc4}.h: Remove duplicate macros

2012-09-28 Thread Daniel Santos
On 09/28/2012 07:23 PM, Josh Triplett wrote: On Fri, Sep 28, 2012 at 06:20:06PM -0500, Daniel Santos wrote: __linktime_error() does the same thing as __compiletime_error() and is only used in bug.h. Since the macro defines a function attribute that will cause a failure at compile-time

Re: [PATCH 7/10] compiler{,-gcc4}.h: Introduce __flatten function attribute

2012-09-28 Thread Daniel Santos
On 09/28/2012 07:26 PM, Josh Triplett wrote: On Fri, Sep 28, 2012 at 06:20:08PM -0500, Daniel Santos wrote: --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h @@ -15,7 +15,12 @@ #if GCC_VERSION = 40102 # define __compiletime_object_size(obj) __builtin_object_size

Re: [PATCH 8/10] bug.h: Make BUILD_BUG_ON generate compile-time error

2012-09-28 Thread Daniel Santos
On 09/28/2012 07:32 PM, Josh Triplett wrote: On Fri, Sep 28, 2012 at 06:20:09PM -0500, Daniel Santos wrote: Negative sized arrays wont create a compile-time error in some cases starting with gcc 4.4 (e.g., inlined functions), but gcc 4.3 introduced the error function attribute

Re: [PATCH 8/10] bug.h: Make BUILD_BUG_ON generate compile-time error

2012-09-28 Thread Daniel Santos
On 09/28/2012 07:32 PM, Josh Triplett wrote: On Fri, Sep 28, 2012 at 06:20:09PM -0500, Daniel Santos wrote: Negative sized arrays wont create a compile-time error in some cases starting with gcc 4.4 (e.g., inlined functions), but gcc 4.3 introduced the error function attribute

  1   2   3   >