lmk: import RB Tree optimization from Motorola
Signed-off-by: Paul Reioux <reioux@gmail.com>

Signed-off-by: DerRomtester <dieb.stefan.96@gmail.com>