public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: dada1 <dada1@cosmosbay.com>
To: Davide Libenzi <davidel@xmailserver.org>
Cc: Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: fs/eventpoll : reduce sizeof(struct epitem)
Date: Wed, 04 Feb 2004 15:22:31 +0100	[thread overview]
Message-ID: <40210027.4080808@cosmosbay.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0402011854560.12618-100000@bigblue.dev.mdolabs.com>

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;


  reply	other threads:[~2004-02-04 14:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-01  3:25 More waitpid issues with CLONE_DETACHED/CLONE_THREAD Daniel Jacobowitz
2004-02-01  4:38 ` Linus Torvalds
2004-02-01  4:43   ` Daniel Jacobowitz
2004-02-01  5:12     ` Daniel Jacobowitz
2004-02-01 21:41       ` Linus Torvalds
2004-02-01 22:25         ` Roland McGrath
2004-02-02  0:55           ` Linus Torvalds
2004-02-02  2:20             ` Andries Brouwer
2004-02-02  2:30               ` Linus Torvalds
2004-02-02  0:52         ` Daniel Jacobowitz
2004-02-02  2:41           ` Davide Libenzi
2004-02-02  2:55             ` Davide Libenzi
2004-02-04 14:22               ` dada1 [this message]
2004-02-05  4:23                 ` fs/eventpoll : reduce sizeof(struct epitem) Davide Libenzi
2004-02-01  5:12     ` More waitpid issues with CLONE_DETACHED/CLONE_THREAD Linus Torvalds
2004-02-01  5:14       ` Daniel Jacobowitz
2004-02-01  5:42         ` Roland McGrath
2004-02-01  5:46           ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40210027.4080808@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=davidel@xmailserver.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox