Optimization/kernel

Various kernel patches & hacks from mainstream