smp: various patches backported from the 3.5 branch