LMK: Import RB Tree optimization from Motorola

Signed-off-by: Paul Reioux <reioux@gmail.com>