public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: george anzinger <george@mvista.com>
To: davidm@hpl.hp.com
Cc: linux-kernel@vger.kernel.org, jim.houston@ccur.com
Subject: Re: POSIX timer syscalls
Date: Fri, 07 Mar 2003 00:24:26 -0800	[thread overview]
Message-ID: <3E68573A.4020206@mvista.com> (raw)
In-Reply-To: <15975.63734.837748.29150@napali.hpl.hp.com>

[-- Attachment #1: Type: text/plain, Size: 1245 bytes --]

David Mosberger wrote:
>>>>>>On Thu, 06 Mar 2003 17:39:16 -0800, george anzinger <george@mvista.com> said:
> 
> 
>   George> Ok, I will fix all the above and shoot you a patch.  I
>   George> assume you can test it on a 64-bit platform.  Right?
> 
The patch to fix idr is attached.  Cleans up the int/long confusion 
and also rearranges a couple of structures to honor the sizes involved.

> Sure, except I don't have a test-program. ;-)
> 
That is why you should visit the High-res-timers web site (see URL 
below) and get the "support" patch.  It installs in you kernel tree at 
.../Documentation/high-res-timers/ and has test programs as well as 
man pages, readme files etc.

By the way, I am seeing some reports from the clock_nanosleep test 
about sleeping too long or too short.  The too long appears to be just 
not being able to preempt what ever else is running.  The too short 
(on the x86) is, I believe, due to the fact that more that 1/HZ is 
clocked on the wall clock each jiffie.

Try this:

time sleep 60

On the x86 it reports less than 60, NOT good.

-- 
George Anzinger   george@mvista.com
High-res-timers:  http://sourceforge.net/projects/high-res-timers/
Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml

[-- Attachment #2: hrtimer-64bit-1.0.patch --]
[-- Type: text/plain, Size: 2600 bytes --]

diff -urP -I '\$Id:.*Exp \$' -X /usr/src/patch.exclude linux-2.5.64-kb/include/linux/idr.h linux/include/linux/idr.h
--- linux-2.5.64-kb/include/linux/idr.h	2003-03-05 15:09:48.000000000 -0800
+++ linux/include/linux/idr.h	2003-03-06 18:04:26.000000000 -0800
@@ -25,9 +25,12 @@
 
 #define IDR_MASK ((1 << IDR_BITS)-1)
 
-/* Leave the possibility of an incomplete final layer */
-#define MAX_LEVEL (BITS_PER_LONG - RESERVED_ID_BITS + IDR_BITS - 1) / IDR_BITS
-#define MAX_ID_SHIFT (BITS_PER_LONG - RESERVED_ID_BITS)
+/* Leave the possibility of an incomplete final layer 
+ * Note we will return a 32-bit int, not a long, thus the
+ * 32 below
+*/
+#define MAX_LEVEL (32 - RESERVED_ID_BITS + IDR_BITS - 1) / IDR_BITS
+#define MAX_ID_SHIFT (32 - RESERVED_ID_BITS)
 #define MAX_ID_BIT (1L << MAX_ID_SHIFT)
 #define MAX_ID_MASK (MAX_ID_BIT - 1)
 
@@ -36,15 +39,15 @@
 
 struct idr_layer {
 	unsigned long	        bitmap;     // A zero bit means "space here"
-	int                     count;      // When zero, we can release it
 	struct idr_layer       *ary[1<<IDR_BITS];
+	int                     count;      // When zero, we can release it
 };
 
 struct idr {
 	struct idr_layer *top;
-	int		  layers;
-	long		  count;
 	struct idr_layer *id_free;
+	long		  count;
+	int		  layers;
 	int               id_free_cnt;
 	spinlock_t        lock;
 };
Binary files linux-2.5.64-kb/lib/gen_crc32table and linux/lib/gen_crc32table differ
diff -urP -I '\$Id:.*Exp \$' -X /usr/src/patch.exclude linux-2.5.64-kb/lib/idr.c linux/lib/idr.c
--- linux-2.5.64-kb/lib/idr.c	2003-03-05 15:09:50.000000000 -0800
+++ linux/lib/idr.c	2003-03-06 18:04:29.000000000 -0800
@@ -150,7 +150,7 @@
 
 static inline int sub_alloc(struct idr *idp, int shift, void *ptr)
 {
-	long n, v = 0;
+	int n, v = 0;
 	struct idr_layer *p;
 	struct idr_layer **pa[MAX_LEVEL];
 	struct idr_layer ***paa = &pa[0];
@@ -211,7 +211,7 @@
 
 int idr_get_new(struct idr *idp, void *ptr)
 {
-	long v;
+	int v;
 	
 	if (idp->id_free_cnt < idp->layers + 1) 
 		return (-1);
Binary files linux-2.5.64-kb/scripts/docproc and linux/scripts/docproc differ
Binary files linux-2.5.64-kb/scripts/fixdep and linux/scripts/fixdep differ
Binary files linux-2.5.64-kb/scripts/kallsyms and linux/scripts/kallsyms differ
Binary files linux-2.5.64-kb/scripts/mk_elfconfig and linux/scripts/mk_elfconfig differ
Binary files linux-2.5.64-kb/scripts/modpost and linux/scripts/modpost differ
Binary files linux-2.5.64-kb/usr/gen_init_cpio and linux/usr/gen_init_cpio differ
Binary files linux-2.5.64-kb/usr/initramfs_data.cpio.gz and linux/usr/initramfs_data.cpio.gz differ

  reply	other threads:[~2003-03-07  8:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-06 23:06 POSIX timer syscalls David Mosberger
2003-03-06 23:53 ` george anzinger
2003-03-07  1:27   ` David Mosberger
2003-03-07  1:39     ` george anzinger
2003-03-07  1:42       ` David Mosberger
2003-03-07  8:24         ` george anzinger [this message]
2003-03-07 10:09           ` Eric Piel
2003-03-07 12:14           ` Eric Piel
2003-03-07 18:16             ` george anzinger
2003-03-07 18:20             ` george anzinger
2003-03-07  0:15 ` Ulrich Drepper

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=3E68573A.4020206@mvista.com \
    --to=george@mvista.com \
    --cc=davidm@hpl.hp.com \
    --cc=jim.houston@ccur.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