Note that I personally do not find anything wrong with recursion, when
used sparingly. Especially in this case recursion just makes things _so_
much easier that not using recursion is not a very good idea in my
opinion, unless it can be done in a really clean way.
I don't dislike your patch: it does what it does really well, and arguably
the tail recursion removal is a good thing in many ways. There is nothing
wrong with having a mixture of recursion and iteration - especially as the
tail removal probably tends to make the "average depth" much less in most
cases.
So I don't actually object to your patch, while I also don't think it is
necessarily needed. I don't like having two ways to do the same thing, but
that mild dislike is balanced by a mild liking of the lower average depth.
So I'm fairly neutral on this patch.
A patch that tries to remove the mid-recursion would be a lot more
involved, and this is why I suspected I wouldn't accept such a patch
before 2.3.x. And I might not accept it even then, if only because I
suspect the recursive algorithm is so much simpler.
So maybe the hybrid approach is the right one. Who knows? I don't have any
strong opinions either way, but this is worth discussing.
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu