lkml.org 
[lkml]   [2004]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectfs/eventpoll : reduce sizeof(struct epitem)
Hi Davide

On a x86_64 platform, I noticed that the size of (struct epitem) is 136
bytes, rounded to 192 (because of L1_CACHE alignment of 64 bytes)

If you reorder some fields of this structure, we can reduce the size to
128 bytes.

The rationale is to group nwait & fd integer (32bits) fields, instead of
mixing them with pointers (64 bits)

See you

Eric Dumazet

diff -u linux-2.6.2/fs/eventpoll.c.save linux-2.6.2/fs/eventpoll.c
--- eventpoll.c.save 2004-02-04 14:59:49.000000000 +0100
+++ eventpoll.c 2004-02-04 15:02:20.000000000 +0100
@@ -241,14 +241,15 @@
/* Number of active wait queue attached to poll operations */
int nwait;

+ /* The file descriptor this item refers to */
+ int fd;
+
/* List containing poll wait queues */
struct list_head pwqlist;

/* The "container" of this item */
struct eventpoll *ep;

- /* The file descriptor this item refers to */
- int fd;

/* The file this item refers to */
struct file *file;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:00    [from the cache]
©2003-2011 Jasper Spaans