diff options
author | Jeff Mahoney <[email protected]> | 2010-10-27 15:34:43 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2010-10-27 18:03:17 -0700 |
commit | 85893120699f8bae8caa12a8ee18ab5fceac978e (patch) | |
tree | 07fb62d6c8818e8feab72d4bd78b3e4a2bbbb829 /tools/perf/scripts/python/syscall-counts.py | |
parent | db9e5679d6aecb17253f41bd06d98194800f9c01 (diff) |
delayacct: align to 8 byte boundary on 64-bit systems
prepare_reply() sets up an skb for the response. The payload contains:
+--------------------------------+
| genlmsghdr - 4 bytes |
+--------------------------------+
| NLA header - 4 bytes | /* Aggregate header */
+-+------------------------------+
| | NLA header - 4 bytes | /* PID header */
| +------------------------------+
| | pid/tgid - 4 bytes |
| +------------------------------+
| | NLA header - 4 bytes | /* stats header */
| + -----------------------------+ <- oops. aligned on 4 byte boundary
| | struct taskstats - 328 bytes |
+-+------------------------------+
The start of the taskstats struct must be 8 byte aligned on IA64 (and
other systems with 8 byte alignment rules for 64-bit types) or runtime
alignment warnings will be issued.
This patch pads the pid/tgid field out to sizeof(long), which forces the
alignment of taskstats. The getdelays userspace code is ok with this
since it assumes 32-bit pid/tgid and then honors that header's length
field.
An array is used to avoid exposing kernel memory contents to userspace in
the response.
Signed-off-by: Jeff Mahoney <[email protected]>
Cc: Balbir Singh <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/syscall-counts.py')
0 files changed, 0 insertions, 0 deletions