diff options
author | Eric Dumazet <dada1@cosmosbay.com> | 2006-12-13 03:34:10 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-13 12:05:48 -0500 |
commit | 6a8ba9d12150461acc91bd3c9124eac19e853218 (patch) | |
tree | faad595c30d5245d637962ecd523744b5f37f4ec /include/linux | |
parent | 0a0c502c94af0491ab454ad6d216c7a6fda8362b (diff) |
[PATCH] reorder struct pipe_buf_operations
Fields of struct pipe_buf_operations have not a precise layout (ie not
optimized to fit cache lines nor reduce cache line ping pongs)
The bufs[] array is *large* and is placed near the beginning of the
structure, so all following fields have a large offset. This is
unfortunate because many archs have smaller instructions when using small
offsets relative to a base register. On x86 for example, 7 bits offsets
have smaller instruction lengths.
Moving bufs[] at the end of pipe_buf_operations permits all fields to have
small offsets, and reduce text size, and icache pressure.
# size vmlinux.pre vmlinux
text data bss dec hex filename
3268989 664356 492196 4425541 438745 vmlinux.pre
3268765 664356 492196 4425317 438665 vmlinux
So this patch reduces text size by 224 bytes on my x86_64 machine. Similar
results on ia32.
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/pipe_fs_i.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index cc902d242c41..2e19478e9e84 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h | |||
@@ -41,7 +41,6 @@ struct pipe_buf_operations { | |||
41 | struct pipe_inode_info { | 41 | struct pipe_inode_info { |
42 | wait_queue_head_t wait; | 42 | wait_queue_head_t wait; |
43 | unsigned int nrbufs, curbuf; | 43 | unsigned int nrbufs, curbuf; |
44 | struct pipe_buffer bufs[PIPE_BUFFERS]; | ||
45 | struct page *tmp_page; | 44 | struct page *tmp_page; |
46 | unsigned int readers; | 45 | unsigned int readers; |
47 | unsigned int writers; | 46 | unsigned int writers; |
@@ -51,6 +50,7 @@ struct pipe_inode_info { | |||
51 | struct fasync_struct *fasync_readers; | 50 | struct fasync_struct *fasync_readers; |
52 | struct fasync_struct *fasync_writers; | 51 | struct fasync_struct *fasync_writers; |
53 | struct inode *inode; | 52 | struct inode *inode; |
53 | struct pipe_buffer bufs[PIPE_BUFFERS]; | ||
54 | }; | 54 | }; |
55 | 55 | ||
56 | /* Differs from PIPE_BUF in that PIPE_SIZE is the length of the actual | 56 | /* Differs from PIPE_BUF in that PIPE_SIZE is the length of the actual |