kernel rbtree code from https://github.com/forhappy/rbtree.git