Decompose insert_wakeup().