rpms/kernel/devel kernel-2.6.spec, 1.3024, 1.3025 linux-2.6-ondemand-timer.patch, 1.4, 1.5

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Thu Mar 29 00:01:00 UTC 2007


Author: davej

Update of /cvs/dist/rpms/kernel/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv17037

Modified Files:
	kernel-2.6.spec linux-2.6-ondemand-timer.patch 
Log Message:
* Wed Mar 28 2007 Dave Jones <davej at redhat.com>
- Update deferred timer patch.



Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/kernel-2.6.spec,v
retrieving revision 1.3024
retrieving revision 1.3025
diff -u -r1.3024 -r1.3025
--- kernel-2.6.spec	27 Mar 2007 23:57:25 -0000	1.3024
+++ kernel-2.6.spec	29 Mar 2007 00:00:55 -0000	1.3025
@@ -2136,6 +2136,9 @@
 #  - tux.
 
 %changelog
+* Wed Mar 28 2007 Dave Jones <davej at redhat.com>
+- Update deferred timer patch.
+
 * Wed Mar 28 2007 David Woodhouse <dwmw2 at redhat.com>
 - Add Efika (mpc52xx) Ethernet driver
 - Crappy workaround for sysfs/uevent problems (#227893)

linux-2.6-ondemand-timer.patch:
 drivers/cpufreq/cpufreq_ondemand.c |    2 -
 include/linux/timer.h              |    1 
 include/linux/workqueue.h          |    6 +++
 kernel/timer.c                     |   65 ++++++++++++++++++++++++++++++++-----
 4 files changed, 65 insertions(+), 9 deletions(-)

Index: linux-2.6-ondemand-timer.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/linux-2.6-ondemand-timer.patch,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- linux-2.6-ondemand-timer.patch	21 Mar 2007 22:30:03 -0000	1.4
+++ linux-2.6-ondemand-timer.patch	29 Mar 2007 00:00:56 -0000	1.5
@@ -1,67 +1,71 @@
-From davej  Wed Mar 21 16:23:54 2007
-Return-path: <linux-kernel-owner+davej=40kernelslacker.org-S964868AbXCUUWo at vger.kernel.org>
+From davej  Wed Mar 28 19:01:19 2007
+Return-path: <venkatesh.pallipadi at intel.com>
 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on
 	gelk.kernelslacker.org
 X-Spam-Level: 
-X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham
+X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham
 	version=3.1.8
-Envelope-to: davej at kernelslacker.org
-Delivery-date: Wed, 21 Mar 2007 20:23:48 +0000
+Envelope-to: davej at codemonkey.org.uk
+Delivery-date: Thu, 29 Mar 2007 00:01:12 +0100
 Received: from testure.choralone.org [194.9.77.134]
 	by gelk.kernelslacker.org with IMAP (fetchmail-6.3.6)
-	for <davej at localhost> (single-drop); Wed, 21 Mar 2007 16:23:54 -0400 (EDT)
-Received: from vger.kernel.org ([209.132.176.167])
+	for <davej at localhost> (single-drop); Wed, 28 Mar 2007 19:01:19 -0400 (EDT)
+Received: from mga01.intel.com ([192.55.52.88])
 	by testure.choralone.org with esmtp (Exim 4.63)
-	(envelope-from <linux-kernel-owner+davej=40kernelslacker.org-S964868AbXCUUWo at vger.kernel.org>)
-	id 1HU7LY-0003Q0-5D
-	for davej at kernelslacker.org; Wed, 21 Mar 2007 20:23:48 +0000
-Received: (majordomo at vger.kernel.org) by vger.kernel.org via listexpand
-	id S964868AbXCUUWo (ORCPT <rfc822;davej at kernelslacker.org>);
-	Wed, 21 Mar 2007 16:22:44 -0400
-Received: (majordomo at vger.kernel.org) by vger.kernel.org id S964931AbXCUUWo
-	(ORCPT <rfc822;linux-kernel-outgoing>);
-	Wed, 21 Mar 2007 16:22:44 -0400
-Received: from mga03.intel.com ([143.182.124.21]:26202 "EHLO mga03.intel.com"
-	rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
-	id S964888AbXCUUWm (ORCPT <rfc822;linux-kernel at vger.kernel.org>);
-	Wed, 21 Mar 2007 16:22:42 -0400
-Received: from azsmga001.ch.intel.com ([10.2.17.19])
-  by mga03.intel.com with ESMTP; 21 Mar 2007 13:22:41 -0700
+	(envelope-from <venkatesh.pallipadi at intel.com>)
+	id 1HWh8h-0006J9-Es
+	for davej at codemonkey.org.uk; Thu, 29 Mar 2007 00:01:11 +0100
+Received: from fmsmga001.fm.intel.com ([10.253.24.23])
+  by mga01.intel.com with ESMTP; 28 Mar 2007 16:01:04 -0700
 Received: from linux-os.sc.intel.com ([172.25.110.8])
-  by azsmga001.ch.intel.com with ESMTP; 21 Mar 2007 13:22:41 -0700
+  by fmsmga001.fm.intel.com with ESMTP; 28 Mar 2007 16:01:03 -0700
 X-ExtLoop1: 1
-X-IronPort-AV: i="4.14,309,1170662400"; 
-   d="scan'208"; a="200302466:sNHT22130717"
+X-IronPort-AV: i="4.14,342,1170662400"; 
+   d="scan'208"; a="221109611:sNHT21096852"
 Received: by linux-os.sc.intel.com (Postfix, from userid 47009)
-	id B382A28006; Wed, 21 Mar 2007 13:22:17 -0700 (PDT)
-Date:	Wed, 21 Mar 2007 13:22:17 -0700
-From:	Venkatesh Pallipadi <venkatesh.pallipadi at intel.com>
-To:	Andrew Morton <akpm at osdl.org>
-Cc:	linux-kernel <linux-kernel at vger.kernel.org>,
-	Dave Jones <davej at redhat.com>, tglx at linutronix.de
-Subject: [PATCH 1/2] Add support for deferrable timers
-Message-ID: <20070321202217.GA29367 at linux-os.sc.intel.com>
+	id AADD228006; Wed, 28 Mar 2007 16:00:21 -0700 (PDT)
+Date: Wed, 28 Mar 2007 16:00:21 -0700
+From: Venki Pallipadi <venkatesh.pallipadi at intel.com>
+To: Oleg Nesterov <oleg at tv-sign.ru>
+Cc: linux-kernel <linux-kernel at vger.kernel.org>,
+	akpm at linux-foundation.org, davej at codemonkey.org.uk,
+	johnstul at us.ibm.com, mingo at elte.hu, tglx at linutronix.de,
+	Andi Kleen <ak at suse.de>
+Subject: Re: [PATCH] Add support for deferrable timers (respun-Mar28)
+Message-ID: <20070328230021.GA29774 at linux-os.sc.intel.com>
+References: <200703212353.l2LNrNOj007453 at shell0.pdx.osdl.net> <20070322140532.GA120 at tv-sign.ru> <20070322151817.GA29840 at linux-os.sc.intel.com> <20070322161355.GA160 at tv-sign.ru> <20070327204344.GA21529 at linux-os.sc.intel.com> <20070327211145.GB216 at tv-sign.ru> <20070327215542.GA27408 at linux-os.sc.intel.com> <20070327222227.GA279 at tv-sign.ru>
 Mime-Version: 1.0
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
+In-Reply-To: <20070327222227.GA279 at tv-sign.ru>
 User-Agent: Mutt/1.4.1i
-Sender:	linux-kernel-owner at vger.kernel.org
-Precedence: bulk
-X-Mailing-List:	linux-kernel at vger.kernel.org
 Status: RO
-Content-Length: 7382
-Lines: 235
+Content-Length: 6118
+Lines: 195
+
+
+Andrew,
 
+Please drop the patch you included yesterday and two incremental patches and
+use the patch below.
 
-Introduce a new flag for timers - 'deferrable timer'
+This patch is - yesterday's patch + Your tidy cleanup +
+minor changes based on comments from Oleg and Andi. This is a lot
+cleaner (and smaller) than earlier patches.
+
+Thanks,
+Venki
+
+
+Introduce a new flag for timers - deferrable:
 Timers that work normally when system is busy. But, will not cause CPU to
 come out of idle (just to service this timer), when CPU is idle. Instead,
 this timer will be serviced when CPU eventually wakes up with a subsequent
-non-deferrable timer or any other event.
+non-deferrable timer.
 
 The main advantage of this is to avoid unnecessary timer interrupts when
 CPU is idle. If the routine currently called by a timer can wait until next
-event without any issues, this new timer can be used while setting up timer
+event without any issues, this new timer can be used to setup timer event
 for that routine. This, with dynticks, allows CPUs to be lazy, allowing them
 to stay in idle for extended period of time by reducing unnecesary wakeup and
 thereby reducing the power consumption.
@@ -77,18 +81,11 @@
 be called in place of regular init_timer().
 
 Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi at intel.com>
----
-
-Modified version of the patches based on earlier attempts.
-http://www.ussg.iu.edu/hypermail/linux/kernel/0703.2/0391.html
-
-Also resolved the soft hangup issue that Dave pointed to in earlier version
-of this patch.
 
 Index: new/kernel/timer.c
 ===================================================================
---- new.orig/kernel/timer.c	2007-03-21 09:16:53.000000000 -0800
-+++ new/kernel/timer.c	2007-03-21 09:18:02.000000000 -0800
+--- new.orig/kernel/timer.c	2007-03-22 16:27:44.000000000 -0800
++++ new/kernel/timer.c	2007-03-28 10:05:38.000000000 -0800
 @@ -74,7 +74,7 @@
  	tvec_t tv3;
  	tvec_t tv4;
@@ -98,143 +95,121 @@
  
  typedef struct tvec_t_base_s tvec_base_t;
  
-@@ -82,6 +82,46 @@
+@@ -82,6 +82,37 @@
  EXPORT_SYMBOL(boot_tvec_bases);
  static DEFINE_PER_CPU(tvec_base_t *, tvec_bases) = &boot_tvec_bases;
  
 +/*
-+ * The lowest bit of base ptr in timer is used as a flag to indicate
-+ * 'deferrable' nature of the timer. Functions below help us manage that flag.
++ * Note that all tvec_bases is 2 byte aligned and lower bit of
++ * base in timer_list is guaranteed to be zero. Use the LSB for
++ * the new flag to indicate whether the timer is deferrable
 + */
-+static inline struct tvec_t_base_s *tbase_get_base_ptr(
-+	struct tvec_t_base_s *base)
-+{
-+	return ((struct tvec_t_base_s *)
-+			((unsigned long)base & (~TBASE_DEFERRABLE_FLAG)));
-+}
++#define TBASE_DEFERRABLE_FLAG		(0x1)
 +
-+static inline unsigned long tbase_get_deferrable_flag(
-+	struct tvec_t_base_s *base)
++/* Functions below help us manage 'deferrable' flag */
++static inline unsigned int tbase_get_deferrable(tvec_base_t *base)
 +{
-+	return ((unsigned long)base & TBASE_DEFERRABLE_FLAG);
++	return ((unsigned int)(unsigned long)base & TBASE_DEFERRABLE_FLAG);
 +}
 +
-+static inline struct tvec_t_base_s *tbase_set_deferrable_flag(
-+	struct tvec_t_base_s *base)
++static inline tvec_base_t *tbase_get_base(tvec_base_t *base)
 +{
-+	return ((struct tvec_t_base_s *)
-+			((unsigned long)base | TBASE_DEFERRABLE_FLAG));
++	return ((tvec_base_t *)((unsigned long)base & ~TBASE_DEFERRABLE_FLAG));
 +}
 +
-+static inline struct tvec_t_base_s *tbase_clear_deferrable_flag(
-+	struct tvec_t_base_s *base)
++static inline void timer_set_deferrable(struct timer_list *timer)
 +{
-+	return ((struct tvec_t_base_s *)
-+			((unsigned long)base & (~TBASE_DEFERRABLE_FLAG)));
++	timer->base = ((tvec_base_t *)((unsigned long)(timer->base) |
++	                               TBASE_DEFERRABLE_FLAG));
 +}
 +
-+static inline struct tvec_t_base_s *tbase_merge_deferrable_flag(
-+	struct tvec_t_base_s *base, unsigned long flag)
++static inline void
++timer_set_base(struct timer_list *timer, tvec_base_t *new_base)
 +{
-+	if (flag & TBASE_DEFERRABLE_FLAG)
-+		return tbase_set_deferrable_flag(base);
-+	else
-+		return tbase_clear_deferrable_flag(base);
++	timer->base = (tvec_base_t *)((unsigned long)(new_base) |
++	                              tbase_get_deferrable(timer->base));
 +}
 +
  /**
   * __round_jiffies - function to round jiffies to a full second
   * @j: the time in (absolute) jiffies that should be rounded
-@@ -295,6 +335,13 @@
+@@ -295,6 +326,13 @@
  }
  EXPORT_SYMBOL(init_timer);
  
 +void fastcall init_timer_deferrable(struct timer_list *timer)
 +{
 +	init_timer(timer);
-+	timer->base = tbase_set_deferrable_flag(timer->base);
++	timer_set_deferrable(timer);
 +}
 +EXPORT_SYMBOL(init_timer_deferrable);
 +
  static inline void detach_timer(struct timer_list *timer,
  				int clear_pending)
  {
-@@ -325,7 +372,7 @@
+@@ -325,10 +363,11 @@
  	tvec_base_t *base;
  
  	for (;;) {
 -		base = timer->base;
-+		base = tbase_get_base_ptr(timer->base);
++		tvec_base_t *prelock_base = timer->base;
++		base = tbase_get_base(prelock_base);
  		if (likely(base != NULL)) {
  			spin_lock_irqsave(&base->lock, *flags);
- 			if (likely(base == timer->base))
-@@ -364,12 +411,15 @@
- 		 * the timer is serialized wrt itself.
+-			if (likely(base == timer->base))
++			if (likely(prelock_base == timer->base))
+ 				return base;
+ 			/* The timer has migrated to another CPU */
+ 			spin_unlock_irqrestore(&base->lock, *flags);
+@@ -365,11 +404,11 @@
  		 */
  		if (likely(base->running_timer != timer)) {
-+			unsigned long tflag;
-+			tflag = tbase_get_deferrable_flag(timer->base);
  			/* See the comment in lock_timer_base() */
- 			timer->base = NULL;
+-			timer->base = NULL;
++			timer_set_base(timer, NULL);
  			spin_unlock(&base->lock);
  			base = new_base;
  			spin_lock(&base->lock);
 -			timer->base = base;
-+			timer->base =
-+				tbase_merge_deferrable_flag(new_base, tflag);
++			timer_set_base(timer, base);
  		}
  	}
  
-@@ -393,11 +443,13 @@
- {
- 	tvec_base_t *base = per_cpu(tvec_bases, cpu);
-   	unsigned long flags;
-+	unsigned long tflag;
- 
+@@ -397,7 +436,7 @@
  	timer_stats_timer_set_start_info(timer);
    	BUG_ON(timer_pending(timer) || !timer->function);
  	spin_lock_irqsave(&base->lock, flags);
 -	timer->base = base;
-+	tflag = tbase_get_deferrable_flag(timer->base);
-+	timer->base = tbase_merge_deferrable_flag(base, tflag);
++	timer_set_base(timer, base);
  	internal_add_timer(base, timer);
  	spin_unlock_irqrestore(&base->lock, flags);
  }
-@@ -524,6 +576,8 @@
-  */
- int del_timer_sync(struct timer_list *timer)
- {
-+	/* Force change the timer flag to be non-deferrable */
-+	timer->base = tbase_clear_deferrable_flag(timer->base);
- 	for (;;) {
- 		int ret = try_to_del_timer_sync(timer);
- 		if (ret >= 0)
-@@ -548,7 +602,7 @@
+@@ -548,7 +587,7 @@
  	 * don't have to detach them individually.
  	 */
  	list_for_each_entry_safe(timer, tmp, &tv_list, entry) {
 -		BUG_ON(timer->base != base);
-+		BUG_ON(tbase_get_base_ptr(timer->base) != base);
++		BUG_ON(tbase_get_base(timer->base) != base);
  		internal_add_timer(base, timer);
  	}
  
-@@ -634,6 +688,9 @@
+@@ -634,6 +673,9 @@
  	index = slot = timer_jiffies & TVR_MASK;
  	do {
  		list_for_each_entry(nte, base->tv1.vec + slot, entry) {
-+ 			if (tbase_get_deferrable_flag(nte->base))
++ 			if (tbase_get_deferrable(nte->base))
 + 				continue;
 + 
  			found = 1;
  			expires = nte->expires;
  			/* Look at the cascade bucket(s)? */
-@@ -1602,6 +1659,13 @@
+@@ -1602,6 +1644,13 @@
  						cpu_to_node(cpu));
  			if (!base)
  				return -ENOMEM;
 +
 +			/* Make sure that tvec_base is 2 byte aligned */
-+			if (tbase_get_deferrable_flag(base)) {
++			if (tbase_get_deferrable(base)) {
 +				WARN_ON(1);
 +				kfree(base);
 +				return -ENOMEM;
@@ -242,51 +217,27 @@
  			memset(base, 0, sizeof(*base));
  			per_cpu(tvec_bases, cpu) = base;
  		} else {
-@@ -1641,9 +1705,11 @@
- 	struct timer_list *timer;
- 
+@@ -1643,7 +1692,7 @@
  	while (!list_empty(head)) {
-+		unsigned long tflag;
  		timer = list_entry(head->next, struct timer_list, entry);
-+		tflag = tbase_get_deferrable_flag(timer->base);
  		detach_timer(timer, 0);
 -		timer->base = new_base;
-+		timer->base = tbase_merge_deferrable_flag(new_base, tflag);
++		timer_set_base(timer, new_base);
  		internal_add_timer(new_base, timer);
  	}
  }
 Index: new/include/linux/timer.h
 ===================================================================
---- new.orig/include/linux/timer.h	2007-03-21 09:16:53.000000000 -0800
-+++ new/include/linux/timer.h	2007-03-21 09:17:16.000000000 -0800
-@@ -8,6 +8,14 @@
- 
- struct tvec_t_base_s;
- 
-+extern struct tvec_t_base_s boot_tvec_bases;
-+/*
-+ * Note that all tvec_bases is 2 byte aligned and lower bit of
-+ * base in timer_list is guaranteed to be zero. Use the LSB for
-+ * the new flag to indicate whether the timer is deferrable
-+ */
-+#define TBASE_DEFERRABLE_FLAG		(0x1)
-+
- struct timer_list {
- 	struct list_head entry;
- 	unsigned long expires;
-@@ -37,6 +45,7 @@
+--- new.orig/include/linux/timer.h	2007-03-22 16:27:44.000000000 -0800
++++ new/include/linux/timer.h	2007-03-28 10:03:14.000000000 -0800
+@@ -37,6 +37,7 @@
  		TIMER_INITIALIZER(_function, _expires, _data)
  
  void fastcall init_timer(struct timer_list * timer);
-+void fastcall init_timer_deferrable(struct timer_list * timer);
++void fastcall init_timer_deferrable(struct timer_list *timer);
  
  static inline void setup_timer(struct timer_list * timer,
  				void (*function)(unsigned long),
--
-To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
-the body of a message to majordomo at vger.kernel.org
-More majordomo info at  http://vger.kernel.org/majordomo-info.html
-Please read the FAQ at  http://www.tux.org/lkml/
 
 From davej  Wed Mar 21 16:25:31 2007
 Return-Path: <venkatesh.pallipadi at intel.com>




More information about the fedora-cvs-commits mailing list