Albert, you are such a loon.
You might as well add ECC bits to all kernel variables and data
structures. That way you can detect when something stomps on
them, and even fix them afterwards. Of course, there is a little
overhead.
If there are only four states you need to distinguish, then using
two bits to encode them _is_ better, because you can dispatch on
all four possible states directly. If you use four bits to
encode four states it's much harder to dispatch (you have to make
more comparisons), not to mention that detecting _all_ the
illegal bit patterns (up to 12 out of the 16) adds a lot of
overhead.
The "you can find bugs by detecting illegal bit patterns" is a red
herring. You _might_ detect bugs when you find illegal bit
patterns. You might also introduce bugs by making a state
machine more complicated than it needs to be.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/