OSDN Git Service

clocksource: Make clocksource insert entry more efficient
authorMinfei Huang <mnghuan@gmail.com>
Mon, 25 Apr 2016 09:20:28 +0000 (17:20 +0800)
committerJohn Stultz <john.stultz@linaro.org>
Mon, 20 Jun 2016 19:46:34 +0000 (12:46 -0700)
commit0fb71d340d355156818bb53eb36ae79a3f88bda9
tree5f4c0147a75e4a7f97a7c0bde6ebf5d50e4c0ff2
parentaf8c34ce6ae32addda3788d54a7e340cad22516b
clocksource: Make clocksource insert entry more efficient

In clocksource_enqueue(), it is unnecessary to continue looping
the list, if we find there is an entry that the value of rating
is smaller than the new one. It is safe to be out the loop,
because all of entry are inserted in descending order.

Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Minfei Huang <mnghuan@gmail.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
kernel/time/clocksource.c