public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Williams <pwil3058@bigpond.net.au>
To: Con Kolivas <kernel@kolivas.org>
Cc: Mike Galbraith <efault@gmx.de>,
	"Randy.Dunlap" <rdunlap@xenotime.net>,
	linux-kernel@vger.kernel.org, mingo@elte.hu,
	nickpiggin@yahoo.com.au, kenneth.w.chen@intel.com, akpm@osdl.org
Subject: Re: [patch 2.6.16-rc5-mm2]  sched_cleanup-V17 - task throttling patch 1 of 2
Date: Mon, 06 Mar 2006 09:29:56 +1100	[thread overview]
Message-ID: <440B6664.5070100@bigpond.net.au> (raw)
In-Reply-To: <200603041750.21484.kernel@kolivas.org>

Con Kolivas wrote:
> On Saturday 04 March 2006 17:50, Mike Galbraith wrote:
> 
>>On Sat, 2006-03-04 at 16:54 +1100, Con Kolivas wrote:
>>
>>>On Saturday 04 March 2006 16:40, Randy.Dunlap wrote:
>>>
>>>>On Sat, 04 Mar 2006 06:29:47 +0100 Mike Galbraith wrote:
>>>>
>>>>>On Sat, 2006-03-04 at 16:24 +1100, Con Kolivas wrote:
>>>>>
>>>>>>On Saturday 04 March 2006 16:20, Mike Galbraith wrote:
>>>>>>
>>>>>>>On Sat, 2006-03-04 at 13:33 +1100, Peter Williams wrote:
>>>>>>>
>>>>>>>>> include/linux/sched.h |    3 -
>>>>>>>>> kernel/sched.c        |  136
>>>>>>>>>+++++++++++++++++++++++++++++--------------------- 2 files
>>>>>>>>>changed, 82 insertions(+), 57 deletions(-)
>>>>>>>>>
>>>>>>>>>--- linux-2.6.16-rc5-mm2/include/linux/sched.h.org	2006-03-01
>>>>>>>>>15:06:22.000000000 +0100 +++
>>>>>>>>>linux-2.6.16-rc5-mm2/include/linux/sched.h	2006-03-02
>>>>>>>>>08:33:12.000000000 +0100 @@ -720,7 +720,8 @@
>>>>>>>>>
>>>>>>>>> 	unsigned long policy;
>>>>>>>>> 	cpumask_t cpus_allowed;
>>>>>>>>>-	unsigned int time_slice, first_time_slice;
>>>>>>>>>+	int time_slice;
>>>>>>>>
>>>>>>>>Can you guarantee that int is big enough to hold a time slice
>>>>>>>>in nanoseconds on all systems?  I think that you'll need more
>>>>>>>>than 16 bits.
>>>>>>>
>>>>>>>Nope, that's a big fat bug.
>>>>>>
>>>>>>Most ints are 32bit anyway, but even a 32 bit unsigned int
>>>>>>overflows with nanoseconds at 4.2 seconds. A signed one at about
>>>>>>half that. Our timeslices are never that large, but then int isn't
>>>>>>always 32bit either.
>>>>>
>>>>>Yup.  I just didn't realize that there were 16 bit integers out
>>>>>there.
>>>>
>>>>LDD 3rd ed. doesn't know about them either.  Same for me.
>>>
>>>Alright I made that up, but it might not be one day :P
>>
>>Well Fudgecicles.  Now you guys have gotten me aaaaall confused.  Are
>>there cpus out there (in generic linux land) that have 16 bit integers
>>or not?  16 bit integers existing in a 32 bit cpu OS seems like an alien
>>concept to me, but I'm not a twisted cpu designer... I'll just go with
>>the flow ;-)
> 
> 
> All supported architectures on linux currently use 32bits for int. That should 
> give you 2.1 seconds in nanoseconds. Sorry my legacy of remembering when ints 
> were 8 bits coloured me.
> 
> Cheers,
> Con

The size of int isn't just a function of the architecture it's also a 
function of the C compiler used.  C requires that longs be at least 32 
bits but only requires that ints be at least 16 bits.  If the 
architecture supports 16 bit integer operations there's nothing to stop 
a VALID compiler from make ints only 16 bits.  Since everyone uses gcc 
(at the moment) it's probably not an (urgent) issue but it seems to me 
that the safe option is to use longs when you want to ensure that you 
get at least 32 bits.

Peter
-- 
Peter Williams                                   pwil3058@bigpond.net.au

"Learning, n. The kind of ignorance distinguishing the studious."
  -- Ambrose Bierce

  parent reply	other threads:[~2006-03-05 22:30 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-17 13:45 [patch 2.6.16-rc3-mm1] Task Throttling V9 MIke Galbraith
2006-02-24 20:29 ` [patch 2.6.16-rc4-mm1] Task Throttling V14 MIke Galbraith
2006-02-24 22:15   ` Andrew Morton
2006-02-25  1:16     ` Peter Williams
2006-02-25  2:20       ` MIke Galbraith
2006-02-25  2:42       ` Nick Piggin
2006-02-25  2:57         ` Con Kolivas
2006-02-25  3:08           ` Nick Piggin
2006-02-25  3:35             ` MIke Galbraith
2006-02-25  2:23     ` MIke Galbraith
2006-03-03 10:43       ` [patch 2.6.16-rc5-mm2] sched_cleanup-V17 - task throttling patch 1 of 2 Mike Galbraith
2006-03-03 10:58         ` [patch 2.6.16-rc5-mm2] sched_throttle-V17 - task throttling patch 2 " Mike Galbraith
2006-03-03 23:58         ` [patch 2.6.16-rc5-mm2] sched_cleanup-V17 - task throttling patch 1 " Peter Williams
2006-03-04  4:54           ` Mike Galbraith
2006-03-04 21:37             ` Peter Williams
2006-03-05  4:53               ` Mike Galbraith
2006-03-05  6:54               ` Mike Galbraith
2006-03-04  2:33         ` Peter Williams
2006-03-04  5:20           ` Mike Galbraith
2006-03-04  5:24             ` Con Kolivas
2006-03-04  5:29               ` Mike Galbraith
2006-03-04  5:40                 ` Randy.Dunlap
2006-03-04  5:54                   ` Con Kolivas
2006-03-04  6:05                     ` Randy.Dunlap
2006-03-04  6:50                     ` Mike Galbraith
2006-03-04  6:50                       ` Con Kolivas
2006-03-04  7:04                         ` Mike Galbraith
2006-03-05 22:29                         ` Peter Williams [this message]
2006-03-04 21:44                       ` Peter Williams
2006-03-04 10:53             ` Mike Galbraith
2006-02-26 11:26   ` [patch 2.6.16-rc4-mm1] Task Throttling V14 Daniel K.
2006-02-26 13:19     ` MIke Galbraith

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=440B6664.5070100@bigpond.net.au \
    --to=pwil3058@bigpond.net.au \
    --cc=akpm@osdl.org \
    --cc=efault@gmx.de \
    --cc=kenneth.w.chen@intel.com \
    --cc=kernel@kolivas.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nickpiggin@yahoo.com.au \
    --cc=rdunlap@xenotime.net \
    /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