* [PATCH] net: remove padding from struct socket on 64bit & increase objects/cache
@ 2008-07-07 11:58 Richard Kennedy
2008-07-08 10:03 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Richard Kennedy @ 2008-07-07 11:58 UTC (permalink / raw)
To: netdev; +Cc: lkml
remove padding from struct socket reducing its size by 8 bytes.
This allows more objects/cache in sock_inode_cache
12 objects/cache when cacheline size is 128 (generic x86_64)
Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
----
compiled & booted on 2.6.26-rc8
Richard
diff --git a/include/linux/net.h b/include/linux/net.h
index 71f7dd5..150a48c 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -106,23 +106,23 @@ enum sock_shutdown_cmd {
/**
* struct socket - general BSD socket
* @state: socket state (%SS_CONNECTED, etc)
+ * @type: socket type (%SOCK_STREAM, etc)
* @flags: socket flags (%SOCK_ASYNC_NOSPACE, etc)
* @ops: protocol specific socket operations
* @fasync_list: Asynchronous wake up list
* @file: File back pointer for gc
* @sk: internal networking protocol agnostic socket representation
* @wait: wait queue for several uses
- * @type: socket type (%SOCK_STREAM, etc)
*/
struct socket {
socket_state state;
+ short type;
unsigned long flags;
const struct proto_ops *ops;
struct fasync_struct *fasync_list;
struct file *file;
struct sock *sk;
wait_queue_head_t wait;
- short type;
};
struct vm_area_struct;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: remove padding from struct socket on 64bit & increase objects/cache
2008-07-07 11:58 [PATCH] net: remove padding from struct socket on 64bit & increase objects/cache Richard Kennedy
@ 2008-07-08 10:03 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2008-07-08 10:03 UTC (permalink / raw)
To: richard; +Cc: netdev, linux-kernel
From: Richard Kennedy <richard@rsk.demon.co.uk>
Date: Mon, 07 Jul 2008 12:58:10 +0100
> remove padding from struct socket reducing its size by 8 bytes.
>
> This allows more objects/cache in sock_inode_cache
> 12 objects/cache when cacheline size is 128 (generic x86_64)
>
> Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
Applied to net-next-2.6, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-08 10:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-07 11:58 [PATCH] net: remove padding from struct socket on 64bit & increase objects/cache Richard Kennedy
2008-07-08 10:03 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).