it was still wrong. cpu_switch() must return 1 when it switched to a different LWP, 0 if it didn't. It was doing exactly the reverse.