From: ERAMOTO Masaya <eramoto.masaya@gmail.com>
To: John Stultz <john.stultz@linaro.org>,
Thomas Gleixner <tglx@linutronix.de>,
linux-kernel@vger.kernel.org
Subject: [PATCH] Time: Clocksource: finish searching when clocksource_enqueue() found the inserting place.
Date: Tue, 17 Sep 2013 03:08:30 +0900 [thread overview]
Message-ID: <5237491E.8080901@gmail.com> (raw)
Hi,
clocksource_enqueue() do extra behavior in the sorted list as below:
* it compares all clocksources in the list even if found the
inserting place.
* it copies to entry until finding there.
So fixed clocksource_enqueue() as below:
* it finishes to compare clocksource when found there.
* it copies to entry only when found there.
Signed-off-by: ERAMOTO Masaya <eramoto.masaya@gmail.com>
---
kernel/time/clocksource.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 50a8736..5b340a4 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -700,9 +700,11 @@ static void clocksource_enqueue(struct clocksource *cs)
list_for_each_entry(tmp, &clocksource_list, list)
/* Keep track of the place, where to insert */
- if (tmp->rating >= cs->rating)
+ if (tmp->rating < cs->rating) {
entry = &tmp->list;
- list_add(&cs->list, entry);
+ break;
+ }
+ list_add_tail(&cs->list, entry);
}
/**
reply other threads:[~2013-09-16 18:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5237491E.8080901@gmail.com \
--to=eramoto.masaya@gmail.com \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox