mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Daniel Walker <dwalker@mvista.com>
Cc: linux-kernel@vger.kernel.org, nickpiggin@yahoo.com.au,
	rostedt@goodmis.org
Subject: Re: sched: 64-bit nr_running
Date: Mon, 15 May 2006 18:34:29 +0200	[thread overview]
Message-ID: <20060515163429.GA16328@elte.hu> (raw)
In-Reply-To: <1147710445.15392.70.camel@c-67-180-134-207.hsd1.ca.comcast.net>


* Daniel Walker <dwalker@mvista.com> wrote:

> > > There was a conversation over the mtd redboot bug related to unsigned 
> > > long vs. unsigned int . On a 64-bit machine unsigned long is 64-bits , 
> > > and unsigned int is 32-bits . However, both are 32-bits on a 32-bit 
> > > machine .
> > > 
> > > Looking over the scheduler I found a few places that use "unsigned 
> > > long" for task counting variables (nr_running, nr_active, 
> > > nr_interruptible) . The problem is that these variables are all bound 
> > > to 29 bits (according to kernel/pid.c) , but they get expanded to 
> > > 64-bits on 64-bit machines .
> > 
> > your point being?
> 
> We could make them unsigned int, and save the extra bits .. Or that's 
> what I was thinking about ..

well for performance it's usually best to just have the native machine 
word size (i.e. long), unless there's some compelling data-structure 
size argument. In any case it's not uncommon to use 'long' for such 
types, even though some other aspect of the kernel limits it to less 
than 64 (or even 32) bits.

	Ingo

  reply	other threads:[~2006-05-15 16:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-15 15:31 Daniel Walker
2006-05-15 16:25 ` Ingo Molnar
2006-05-15 16:27   ` Daniel Walker
2006-05-15 16:34     ` Ingo Molnar [this message]
2006-05-15 17:45       ` Daniel Walker

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=20060515163429.GA16328@elte.hu \
    --to=mingo@elte.hu \
    --cc=dwalker@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=rostedt@goodmis.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

all inboxes | Powered by JetHome®