- clocksource-refactor-duplicate-registration-checking.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     clocksource: refactor duplicate registration checking
has been removed from the -mm tree.  Its filename was
     clocksource-refactor-duplicate-registration-checking.patch

This patch was dropped because of general bunfight

------------------------------------------------------
Subject: clocksource: refactor duplicate registration checking
From: Daniel Walker <dwalker@xxxxxxxxxx>

Refactors the duplicate registration checking. This makes it based on the
clocksource structure list state. I was able to drop some if statements
making the registration code path slightly smaller and faster, and remove
some looping which was endemic of the first version of this check.

Signed-off-by: Daniel Walker <dwalker@xxxxxxxxxx>
Cc: Russell King <rmk@xxxxxxxxxxxxxxxx>
Cc: Kyle McMartin <kyle@xxxxxxxxxxx>
Cc: Grant Grundler <grundler@xxxxxxxxxxxxxxxx>
Cc: Matthew Wilcox <willy@xxxxxxxxxx>
Cc: Haavard Skinnemoen <hskinnemoen@xxxxxxxxx>
Cc: Ralf Baechle <ralf@xxxxxxxxxxxxxx>
Cc: Andi Kleen <ak@xxxxxxx>
Cc: Heiko Carstens <heiko.carstens@xxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: john stultz <johnstul@xxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 include/linux/clocksource.h |    2 +-
 kernel/time/clocksource.c   |   30 ++++++++++++++++++------------
 kernel/time/jiffies.c       |    1 +
 3 files changed, 20 insertions(+), 13 deletions(-)

diff -puN include/linux/clocksource.h~clocksource-refactor-duplicate-registration-checking include/linux/clocksource.h
--- a/include/linux/clocksource.h~clocksource-refactor-duplicate-registration-checking
+++ a/include/linux/clocksource.h
@@ -26,7 +26,7 @@ struct clocksource;
  *	Provides mostly state-free accessors to the underlying hardware.
  *
  * @name:		ptr to clocksource name
- * @list:		list head for registration
+ * @list:		list head for registration, must be initialized.
  * @rating:		rating value for selection (higher is better)
  *			To avoid rating inflation the following
  *			list should give you a guide as to how
diff -puN kernel/time/clocksource.c~clocksource-refactor-duplicate-registration-checking kernel/time/clocksource.c
--- a/kernel/time/clocksource.c~clocksource-refactor-duplicate-registration-checking
+++ a/kernel/time/clocksource.c
@@ -232,7 +232,7 @@ static struct clocksource *select_clocks
 /*
  * Enqueue the clocksource sorted by rating
  */
-static int clocksource_enqueue(struct clocksource *c)
+static void clocksource_enqueue(struct clocksource *c)
 {
 	struct list_head *tmp, *entry = &clocksource_list;
 
@@ -240,8 +240,7 @@ static int clocksource_enqueue(struct cl
 		struct clocksource *cs;
 
 		cs = list_entry(tmp, struct clocksource, list);
-		if (cs == c)
-			return -EBUSY;
+
 		/* Keep track of the place, where to insert */
 		if (cs->rating >= c->rating)
 			entry = tmp;
@@ -252,28 +251,35 @@ static int clocksource_enqueue(struct cl
 	    !strcmp(c->name, override_name))
 		clocksource_override = c;
 
-	return 0;
 }
 
 /**
  * clocksource_register - Used to install new clocksources
  * @t:		clocksource to be registered
  *
- * Returns -EBUSY if registration fails, zero otherwise.
+ * Always returns zero.
  */
 int clocksource_register(struct clocksource *c)
 {
 	unsigned long flags;
-	int ret;
+
+	/*
+	 * This BUGON indicates that either the clocksource has been
+	 * registered already, or the list element hasn't been properly
+	 * initialized.
+	 */
+	BUG_ON(!list_empty(&c->list));
 
 	spin_lock_irqsave(&clocksource_lock, flags);
-	ret = clocksource_enqueue(c);
-	if (!ret)
-		next_clocksource = select_clocksource();
+
+	clocksource_enqueue(c);
+	next_clocksource = select_clocksource();
+
 	spin_unlock_irqrestore(&clocksource_lock, flags);
-	if (!ret)
-		clocksource_check_watchdog(c);
-	return ret;
+
+	clocksource_check_watchdog(c);
+
+	return 0;
 }
 EXPORT_SYMBOL(clocksource_register);
 
diff -puN kernel/time/jiffies.c~clocksource-refactor-duplicate-registration-checking kernel/time/jiffies.c
--- a/kernel/time/jiffies.c~clocksource-refactor-duplicate-registration-checking
+++ a/kernel/time/jiffies.c
@@ -62,6 +62,7 @@ struct clocksource clocksource_jiffies =
 	.mask		= 0xffffffff, /*32bits*/
 	.mult		= NSEC_PER_JIFFY << JIFFIES_SHIFT, /* details above */
 	.shift		= JIFFIES_SHIFT,
+	.list		= LIST_HEAD_INIT(clocksource_jiffies.list),
 };
 
 static int __init init_jiffies_clocksource(void)
_

Patches currently in -mm which might be from dwalker@xxxxxxxxxx are

clocksource-refactor-duplicate-registration-checking.patch
slim-make-and-config-stuff.patch
profile-likely-unlikely-macros.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux