lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <45CB4C55.4070902@redhat.com>
Date:	Thu, 08 Feb 2007 11:14:13 -0500
From:	William Cohen <wcohen@...hat.com>
To:	linux-kernel@...r.kernel.org
Subject: Size of 2.6.20 task_struct on x86_64 machines

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"?

The patch below drops the size of the struct from 3808 bytes (60
64-byte cachelines) to 3760 bytes (59 64-byte cachelines). A couple
other fields in the task struct take a signficant amount of space:

struct thread_struct       thread;               688
struct held_lock           held_locks[30];       1680

CONFIG_LOCKDEP is turned on in the .config

-Will

View attachment "task_struct_compress.diff" of type "text/x-patch" (1364 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ