In versions of Linux kernel 2.6 prior to 2.6.23, the scheduler used is an O(1) scheduler by Ingo Molnár.
The scheduler used thereafter is the Completely Fair Scheduler, also by Ingo Molnár, which runs in O(log N) time.
Check out wikipedia article
The following two tutorials completely explains O(1) scheduling Tutorial 1 and Tutorial 2