[lkml]   [2007]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Size of 2.6.20 task_struct on x86_64 machines
From: William Cohen <>
Date: Thu, 08 Feb 2007 11:14:13 -0500

> This past week I was playing around with that pahole tool
> ( 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.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-02-08 21:23    [W:0.092 / U:1.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site