Fast and flexible scheduling across the system stack