perf sched: Tighten up the code