Backport stud SMF from trunk.