Prev: [PATCH v4 0/2] cgroups: implement moving a threadgroup's threads atomically with cgroup.procs
Next: [PATCH v4 1/2] cgroups: read-write lock CLONE_THREAD forking per threadgroup
From: Luis R. Rodriguez on 30 Jul 2010 20:00 For good while now I have been using unsigned int for every looper iterator I implement on the kernel. I remember I picked this practice up from Jiri but I just tried to look for actual documentation of this online and could not find much. A simple test would be to run a series of loop tests on different architectures with a regular int and then with an unsigned int to see if performance improves but I obviously don't have access to many machines with varying architectures. So if you also follow this practice have you actually found evidence for this practice, have you actually measured performance metrics? Or is this just a urban hacker legend? Please CC me as i am not subscribed to lkml. Luis -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: David Newall on 31 Jul 2010 05:40
I don't know about unsigned int; but looping down to zero should be faster on many architectures, as they automatically test for zero (or negative) on decrement. Counting up requires an additional test. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |