public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Walker <dwalker@mvista.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH 09/12] clocksource: initialize list value
Date: Mon, 22 Jan 2007 21:53:04 -0800	[thread overview]
Message-ID: <20070123055347.343994209@mvista.com> (raw)
In-Reply-To: 20070123055255.338254780@mvista.com

[-- Attachment #1: clocksource_list_init.patch --]
[-- Type: text/plain, Size: 1666 bytes --]

A change to clocksource initialization. If the list field is initialized 
it allows clocksource_register to complete faster since it doesn't have 
to scan the list of clocks doing strcmp on each looking for duplicates.

Signed-Off-By: Daniel Walker <dwalker@mvista.com>

---
 kernel/time/clocksource.c |    3 +--
 kernel/time/jiffies.c     |    1 +
 2 files changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6.19/kernel/time/clocksource.c
===================================================================
--- linux-2.6.19.orig/kernel/time/clocksource.c
+++ linux-2.6.19/kernel/time/clocksource.c
@@ -186,12 +186,11 @@ int clocksource_register(struct clocksou
 	unsigned long flags;
 
 	spin_lock_irqsave(&clocksource_lock, flags);
-	if (unlikely(!list_empty(&c->list) && __is_registered(c->name))) {
+	if (unlikely(!list_empty(&c->list))) {
 		printk("register_clocksource: Cannot register %s clocksource. "
 		       "Already registered!", c->name);
 		ret = -EBUSY;
 	} else {
-		INIT_LIST_HEAD(&c->list);
  		__sorted_list_add(c);
 		/* scan the registered clocksources, and pick the best one */
 		next_clocksource = select_clocksource();
Index: linux-2.6.19/kernel/time/jiffies.c
===================================================================
--- linux-2.6.19.orig/kernel/time/jiffies.c
+++ linux-2.6.19/kernel/time/jiffies.c
@@ -63,6 +63,7 @@ struct clocksource clocksource_jiffies =
 	.mult		= NSEC_PER_JIFFY << JIFFIES_SHIFT, /* details above */
 	.shift		= JIFFIES_SHIFT,
 	.is_continuous	= 0, /* tick based, not free running */
+	.list		= LIST_HEAD_INIT(clocksource_jiffies.list),
 };
 
 static int __init init_jiffies_clocksource(void)

-- 

  parent reply	other threads:[~2007-01-23  5:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-23  5:52 [PATCH 00/12] clocksource/timekeeping cleanup Daniel Walker
2007-01-23  5:52 ` [PATCH 01/12] timekeeping: create kernel/time/timekeeping.c Daniel Walker
2007-01-23  5:52 ` [PATCH 02/12] clocksource: rating sorted list Daniel Walker
2007-01-23  5:52 ` [PATCH 03/12] clocksource: arm initialize list value Daniel Walker
2007-01-23  5:52 ` [PATCH 04/12] clocksource: avr32 " Daniel Walker
2007-01-23 12:42   ` Haavard Skinnemoen
2007-01-23 13:02     ` Daniel Walker
2007-01-23 13:44       ` Haavard Skinnemoen
2007-01-23  5:53 ` [PATCH 05/12] clocksource: mips " Daniel Walker
2007-01-23  5:53 ` [PATCH 06/12] clocksource: i386 " Daniel Walker
2007-01-23  5:53 ` [PATCH 07/12] clocksource: x86_64 " Daniel Walker
2007-01-23  5:53 ` [PATCH 08/12] clocksource: driver " Daniel Walker
2007-01-23  5:53 ` Daniel Walker [this message]
2007-01-23  5:53 ` [PATCH 10/12] clocksource: add block notifier Daniel Walker
2007-01-23  5:53 ` [PATCH 11/12] clocksource: remove update_callback Daniel Walker
2007-01-23  5:53 ` [PATCH 12/12] clocksource: atomic signals Daniel Walker

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=20070123055347.343994209@mvista.com \
    --to=dwalker@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    /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