public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix posix_bump_timer args
@ 2005-07-06 18:26 Geoff Levand
  2005-07-07  0:17 ` randy_dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: Geoff Levand @ 2005-07-06 18:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: George Anzinger

This patch makes posix_bump_timer() consistent with common convention 
by expecting a pointer to the structure be passed.

Please apply.


Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> for CELF

--
--- linux-2.6.12.1.orig/include/linux/posix-timers.h	2005-06-17 12:48:29.000000000 -0700
+++ linux-2.6.12.1/include/linux/posix-timers.h.bump	2005-07-06 10:58:52.000000000 -0700
@@ -108,7 +108,7 @@
 #define posix_bump_timer(timr, now)					\
          do {								\
               long delta, orun;						\
-	      delta = now.jiffies - (timr)->it.real.timer.expires;	\
+	      delta = (now)->jiffies - (timr)->it.real.timer.expires;	\
               if (delta >= 0) {						\
 	           orun = 1 + (delta / (timr)->it.real.incr);		\
 	          (timr)->it.real.timer.expires +=			\

--- linux-2.6.12.1.orig/kernel/posix-timers.c	2005-06-17 12:48:29.000000000 -0700
+++ linux-2.6.12.1/kernel/posix-timers.c.bump	2005-07-06 10:54:48.000000000 -0700
@@ -384,11 +384,11 @@
 		spin_lock(&abs_list.lock);
 		add_clockset_delta(timr, &new_wall_to);
 
-		posix_bump_timer(timr, now);
+		posix_bump_timer(timr, &now);
 
 		spin_unlock(&abs_list.lock);
 	} else {
-		posix_bump_timer(timr, now);
+		posix_bump_timer(timr, &now);
 	}
 	timr->it_overrun_last = timr->it_overrun;
 	timr->it_overrun = -1;
@@ -810,7 +810,7 @@
 	if (expires) {
 		if (timr->it_requeue_pending & REQUEUE_PENDING ||
 		    (timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE) {
-			posix_bump_timer(timr, now);
+			posix_bump_timer(timr, &now);
 			expires = timr->it.real.timer.expires;
 		}
 		else



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix posix_bump_timer args
  2005-07-06 18:26 [PATCH] Fix posix_bump_timer args Geoff Levand
@ 2005-07-07  0:17 ` randy_dunlap
  2005-07-07  0:40   ` Geoff Levand
  0 siblings, 1 reply; 3+ messages in thread
From: randy_dunlap @ 2005-07-07  0:17 UTC (permalink / raw)
  To: Geoff Levand; +Cc: linux-kernel, george

On Wed, 06 Jul 2005 11:26:31 -0700 Geoff Levand wrote:

| This patch makes posix_bump_timer() consistent with common convention 
| by expecting a pointer to the structure be passed.
| 
| Please apply.

Does it matter other than for consistency?

E.g., in a large system with thousands of timers, it seems that it
could (at least theoretically) have a negative impact by using a
pointer dereference instead of a known fixed address.
or am I just imagining that?

Thanks,
~Randy

| Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> for CELF
| 
| --
| --- linux-2.6.12.1.orig/include/linux/posix-timers.h	2005-06-17 12:48:29.000000000 -0700
| +++ linux-2.6.12.1/include/linux/posix-timers.h.bump	2005-07-06 10:58:52.000000000 -0700
| @@ -108,7 +108,7 @@
|  #define posix_bump_timer(timr, now)					\
|           do {								\
|                long delta, orun;						\
| -	      delta = now.jiffies - (timr)->it.real.timer.expires;	\
| +	      delta = (now)->jiffies - (timr)->it.real.timer.expires;	\
|                if (delta >= 0) {						\
|  	           orun = 1 + (delta / (timr)->it.real.incr);		\
|  	          (timr)->it.real.timer.expires +=			\
| 
| --- linux-2.6.12.1.orig/kernel/posix-timers.c	2005-06-17 12:48:29.000000000 -0700
| +++ linux-2.6.12.1/kernel/posix-timers.c.bump	2005-07-06 10:54:48.000000000 -0700
| @@ -384,11 +384,11 @@
|  		spin_lock(&abs_list.lock);
|  		add_clockset_delta(timr, &new_wall_to);
|  
| -		posix_bump_timer(timr, now);
| +		posix_bump_timer(timr, &now);
|  
|  		spin_unlock(&abs_list.lock);
|  	} else {
| -		posix_bump_timer(timr, now);
| +		posix_bump_timer(timr, &now);
|  	}
|  	timr->it_overrun_last = timr->it_overrun;
|  	timr->it_overrun = -1;
| @@ -810,7 +810,7 @@
|  	if (expires) {
|  		if (timr->it_requeue_pending & REQUEUE_PENDING ||
|  		    (timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE) {
| -			posix_bump_timer(timr, now);
| +			posix_bump_timer(timr, &now);
|  			expires = timr->it.real.timer.expires;
|  		}
|  		else

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix posix_bump_timer args
  2005-07-07  0:17 ` randy_dunlap
@ 2005-07-07  0:40   ` Geoff Levand
  0 siblings, 0 replies; 3+ messages in thread
From: Geoff Levand @ 2005-07-07  0:40 UTC (permalink / raw)
  To: randy_dunlap; +Cc: linux-kernel, george

randy_dunlap wrote:
> On Wed, 06 Jul 2005 11:26:31 -0700 Geoff Levand wrote:
> 
> | This patch makes posix_bump_timer() consistent with common convention 
> | by expecting a pointer to the structure be passed.
> | 
> | Please apply.
> 
> Does it matter other than for consistency?
> 
> E.g., in a large system with thousands of timers, it seems that it
> could (at least theoretically) have a negative impact by using a
> pointer dereference instead of a known fixed address.
> or am I just imagining that?
> 

I pulled this out of the HRT patches.  In general it was agreed that 
the change is for the best.

-Geoff

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-07-07  0:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-06 18:26 [PATCH] Fix posix_bump_timer args Geoff Levand
2005-07-07  0:17 ` randy_dunlap
2005-07-07  0:40   ` Geoff Levand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox