From: Daniel Walker <dwalker@mvista.com>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org, johnstul@us.ibm.com
Subject: [PATCH 08/10] -mm: clocksource: initialize list value
Date: Fri, 06 Oct 2006 11:54:47 -0700 [thread overview]
Message-ID: <20061006185457.308808000@mvista.com> (raw)
In-Reply-To: 20061006185439.667702000@mvista.com
[-- Attachment #1: clocksouce_list_init.patch --]
[-- Type: text/plain, Size: 3803 bytes --]
A change to clocksource initialization. It's optional for new clocksources,
but prefered. If the list field is initialized it allows clocksource_register
to complete faster since it doesn't have the scan the list of clocks doing
strcmp on each.
Signed-Off-By: Daniel Walker <dwalker@mvista.com>
---
arch/i386/kernel/hpet.c | 1 +
arch/i386/kernel/i8253.c | 1 +
arch/i386/kernel/tsc.c | 1 +
drivers/clocksource/acpi_pm.c | 1 +
drivers/clocksource/cyclone.c | 1 +
drivers/clocksource/scx200_hrt.c | 1 +
include/linux/clocksource.h | 3 +++
7 files changed, 9 insertions(+)
Index: linux-2.6.18/arch/i386/kernel/hpet.c
===================================================================
--- linux-2.6.18.orig/arch/i386/kernel/hpet.c
+++ linux-2.6.18/arch/i386/kernel/hpet.c
@@ -27,6 +27,7 @@ static struct clocksource clocksource_hp
.mult = 0, /* set below */
.shift = HPET_SHIFT,
.is_continuous = 1,
+ .list = CLOCKSOURCE_LIST_INIT(clocksource_hpet.list),
};
static int __init init_hpet_clocksource(void)
Index: linux-2.6.18/arch/i386/kernel/i8253.c
===================================================================
--- linux-2.6.18.orig/arch/i386/kernel/i8253.c
+++ linux-2.6.18/arch/i386/kernel/i8253.c
@@ -105,6 +105,7 @@ static struct clocksource clocksource_pi
.mask = CLOCKSOURCE_MASK(32),
.mult = 0,
.shift = 20,
+ .list = CLOCKSOURCE_LIST_INIT(clocksource_pit.list),
};
static int __init init_pit_clocksource(void)
Index: linux-2.6.18/arch/i386/kernel/tsc.c
===================================================================
--- linux-2.6.18.orig/arch/i386/kernel/tsc.c
+++ linux-2.6.18/arch/i386/kernel/tsc.c
@@ -350,6 +350,7 @@ static struct clocksource clocksource_ts
.mult = 0, /* to be set */
.shift = 22,
.is_continuous = 1,
+ .list = CLOCKSOURCE_LIST_INIT(clocksource_tsc.list),
};
Index: linux-2.6.18/drivers/clocksource/acpi_pm.c
===================================================================
--- linux-2.6.18.orig/drivers/clocksource/acpi_pm.c
+++ linux-2.6.18/drivers/clocksource/acpi_pm.c
@@ -73,6 +73,7 @@ static struct clocksource clocksource_ac
.mult = 0, /*to be caluclated*/
.shift = 22,
.is_continuous = 1,
+ .list = CLOCKSOURCE_LIST_INIT(clocksource_acpi_pm.list),
};
Index: linux-2.6.18/drivers/clocksource/cyclone.c
===================================================================
--- linux-2.6.18.orig/drivers/clocksource/cyclone.c
+++ linux-2.6.18/drivers/clocksource/cyclone.c
@@ -32,6 +32,7 @@ static struct clocksource clocksource_cy
.mult = 10,
.shift = 0,
.is_continuous = 1,
+ .list = CLOCKSOURCE_LIST_INIT(clocksource_cyclone.list),
};
static int __init init_cyclone_clocksource(void)
Index: linux-2.6.18/drivers/clocksource/scx200_hrt.c
===================================================================
--- linux-2.6.18.orig/drivers/clocksource/scx200_hrt.c
+++ linux-2.6.18/drivers/clocksource/scx200_hrt.c
@@ -58,6 +58,7 @@ static struct clocksource cs_hrt = {
.read = read_hrt,
.mask = CLOCKSOURCE_MASK(32),
.is_continuous = 1,
+ .list = CLOCKSOURCE_LIST_INIT(cs_hrt.list),
/* mult, shift are set based on mhz27 flag */
};
Index: linux-2.6.18/include/linux/clocksource.h
===================================================================
--- linux-2.6.18.orig/include/linux/clocksource.h
+++ linux-2.6.18/include/linux/clocksource.h
@@ -82,6 +82,9 @@ struct clocksource {
/* simplify initialization of mask field */
#define CLOCKSOURCE_MASK(bits) (cycle_t)(bits<64 ? ((1ULL<<bits)-1) : -1)
+/* Abstracted list initialization */
+#define CLOCKSOURCE_LIST_INIT(x) LIST_HEAD_INIT(x)
+
/**
* clocksource_khz2mult - calculates mult from khz and shift
* @khz: Clocksource frequency in KHz
--
next prev parent reply other threads:[~2006-10-06 18:58 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-06 18:54 [PATCH 00/10] -mm: generic clocksource API -v2 Daniel Walker
2006-10-06 18:54 ` [PATCH 01/10] -mm: clocksource: increase initcall priority Daniel Walker
2006-10-07 15:40 ` OGAWA Hirofumi
2006-10-07 16:51 ` Daniel Walker
2006-10-07 18:00 ` OGAWA Hirofumi
2006-10-07 18:41 ` OGAWA Hirofumi
2006-10-07 18:44 ` Daniel Walker
2006-10-07 19:19 ` OGAWA Hirofumi
2006-10-09 18:50 ` john stultz
2006-10-09 19:24 ` Daniel Walker
2006-10-09 19:49 ` Thomas Gleixner
2006-10-06 18:54 ` [PATCH 02/10] -mm: clocksource: small cleanup Daniel Walker
2006-10-09 18:51 ` john stultz
2006-10-06 18:54 ` [PATCH 03/10] -mm: clocksource: move old API calls Daniel Walker
2006-10-06 18:54 ` [PATCH 04/10] -mm: clocksource: add some new " Daniel Walker
2006-10-09 19:01 ` john stultz
2006-10-06 18:54 ` [PATCH 05/10] -mm: clocksource: convert generic timeofday Daniel Walker
2006-10-07 23:04 ` Oleg Verych
2006-10-09 19:39 ` john stultz
2006-10-09 20:19 ` Daniel Walker
2006-10-06 18:54 ` [PATCH 06/10] -mm: clocksource: add block notifier Daniel Walker
2006-10-09 19:45 ` john stultz
2006-10-06 18:54 ` [PATCH 07/10] -mm: clocksource: remove update_callback Daniel Walker
2006-10-09 19:56 ` john stultz
2006-10-06 18:54 ` Daniel Walker [this message]
2006-10-09 19:59 ` [PATCH 08/10] -mm: clocksource: initialize list value john stultz
2006-10-06 18:54 ` [PATCH 09/10] -mm: clocksource: add generic sched_clock() Daniel Walker
2006-10-06 18:54 ` [PATCH 10/10] -mm: clocksource: update kernel parameters Daniel Walker
2006-10-07 1:53 ` [PATCH 00/10] -mm: generic clocksource API -v2 Andrew Morton
2006-10-07 3:10 ` 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=20061006185457.308808000@mvista.com \
--to=dwalker@mvista.com \
--cc=akpm@osdl.org \
--cc=johnstul@us.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.