All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: David Miller <davem@davemloft.net>
Cc: wcohen@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: Size of 2.6.20 task_struct on x86_64 machines
Date: Thu, 8 Feb 2007 13:03:00 -0800	[thread overview]
Message-ID: <20070208130300.e819bd7f.akpm@linux-foundation.org> (raw)
In-Reply-To: <20070208.121945.102574093.davem@davemloft.net>

On Thu, 08 Feb 2007 12:19:45 -0800 (PST)
David Miller <davem@davemloft.net> wrote:

> From: William Cohen <wcohen@redhat.com>
> Date: Thu, 08 Feb 2007 11:14:13 -0500
> 
> > This past week I was playing around with that pahole tool
> > (http://oops.ghostprotocols.net:81/acme/dwarves/) and looking at the
> > size of various struct in the kernel. I was surprised by the size of
> > the task_struct on x86_64, approaching 4K.  I looked through the
> > fields in task_struct and found that a number of them were declared as
> > "unsigned long" rather than "unsigned int" despite them appearing okay
> > as 32-bit sized fields. On x86_64 "unsigned long" ends up being 8
> > bytes in size and forces 8 byte alignment. Is there a reason there
> > a reason they are "unsigned long"?
> 
> I think at one point we used the atomic bit operations to operate on
> things like tsk->flags, and those interfaces require unsigned long as
> the type.
> 
> That doesn't appear to be the case any longer, so at a minimum
> your tsk->flags conversion to unsigned int should be ok.

Yeah, afacit everything in there is OK and happily all the
converted-to-32-bit quantities happen to be contiguous with other 32-bit
quantities.

Most architectures' bitops functions take unsigned long * so if anyone is
using bitops on these things we should get to hear about it.


  reply	other threads:[~2007-02-08 21:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-08 16:14 Size of 2.6.20 task_struct on x86_64 machines William Cohen
2007-02-08 20:19 ` David Miller
2007-02-08 21:03   ` Andrew Morton [this message]
2007-02-11  0:20 ` Dave Jones
2007-02-11  2:55   ` Linus Torvalds

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=20070208130300.e819bd7f.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wcohen@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.