From: Eric Dumazet <dada1@cosmosbay.com>
To: Davide Libenzi <davidel@xmailserver.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] eventpoll : Suppress a short lived lock from struct file
Date: Mon, 11 Jul 2005 17:20:11 +0200 [thread overview]
Message-ID: <42D28E2B.7050707@cosmosbay.com> (raw)
In-Reply-To: <Pine.LNX.4.63.0507110642550.7209@localhost.localdomain>
Davide Libenzi a écrit :
> Eric, I can't really say I like this one. Not at least after extensive
> tests run on top of it.
fair enough :)
> You are asking to add a bottleneck to save 8
> bytes on an entity that taken alone in more than 120 bytes. Consider
> that when you have a "struct file" allocated, the cost on the system is
> not only the struct itself, but all the allocations associated with it.
> For example, if you consider that a case where you might feel a "struct
> file" pressure is when you have hundreds of thousands of network
> connections, the 8 bytes saved compared to all the buffers associated
> with those sockets boils down to basically nothing.
Well, the filp_cachep slab is created with SLAB_HWCACHE_ALIGN, enforcing a alignment of 64 bytes or even 128 bytes.
So it can be usefull to let the size of struct file goes from 0x84 to 0x80, because we can gain 64 or 128 bytes per file (0x80 bytes really
allocated instead of 0xc0 or even 0x100 on Pentium 4).
In my case, I use other patches outside the scope of eventpoll (like declaring f_security only #ifdef CONFIG_SECURITY_SELINUX), and really
gain 128 bytes of low memory per file. It reduces cache pressure for a given workload, and reduce lowmem pressure.
Before :
# grep filp /proc/slabinfo
filp 66633 66750 256 15 1 : tunables 120 60 8 : slabdata 4450 4450 60
After :
# grep filp /proc/slabinfo
filp 82712 82987 128 31 1 : tunables 120 60 8 : slabdata 2677 2677 20
It may appears to you as a penalty, but at least for me it is a noticeable gain.
Another candidate to "file struct" size reduction is the big struct file_ra_state that is included in all files, even sockets that dont use
it, but that's a different story :)
Eric
next prev parent reply other threads:[~2005-07-11 15:23 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-18 3:19 [PATCH x86_64] Live Patching Function on 2.6.11.7 Takashi Ikebe
2005-04-18 4:07 ` Chris Wedgwood
2005-04-18 4:19 ` Takashi Ikebe
2005-04-18 4:42 ` Daniel Jacobowitz
2005-04-18 4:55 ` Nicholas Miell
2005-04-18 5:01 ` Davide Libenzi
2005-04-18 5:41 ` Takashi Ikebe
2005-07-11 7:18 ` [PATCH] eventpoll : Suppress a short lived lock from struct file Eric Dumazet
2005-07-11 8:34 ` Peter Zijlstra
2005-07-11 9:29 ` Eric Dumazet
2005-07-11 14:00 ` Davide Libenzi
2005-07-11 15:20 ` Eric Dumazet [this message]
2005-04-18 5:00 ` [PATCH x86_64] Live Patching Function on 2.6.11.7 David S. Miller
2005-04-18 6:12 ` Chris Wedgwood
2005-04-18 6:35 ` Chris Friesen
2005-04-18 6:48 ` Chris Wedgwood
2005-04-18 10:03 ` James Courtier-Dutton
2005-04-18 9:10 ` Chris Wedgwood
2005-04-18 7:32 ` Takashi Ikebe
2005-04-18 7:56 ` Chris Wedgwood
2005-04-18 8:37 ` Takashi Ikebe
2005-04-18 8:59 ` Chris Wedgwood
2005-04-18 9:16 ` Paul Jackson
2005-04-18 9:25 ` Chris Wedgwood
2005-04-18 11:30 ` Rik van Riel
2005-04-18 12:52 ` Takashi Ikebe
2005-04-18 14:06 ` Rik van Riel
2005-04-19 2:14 ` Takashi Ikebe
2005-04-19 4:27 ` Chris Wedgwood
2005-04-19 5:19 ` Takashi Ikebe
2005-04-19 5:52 ` Chris Wedgwood
2005-04-20 4:18 ` Takashi Ikebe
2005-04-20 5:43 ` Chris Wedgwood
2005-04-20 7:35 ` Takashi Ikebe
2005-04-20 7:50 ` Chris Wedgwood
2005-04-20 7:57 ` Takashi Ikebe
2005-04-20 8:26 ` Chris Wedgwood
2005-04-20 8:45 ` Takashi Ikebe
2005-04-20 8:51 ` Chris Wedgwood
2005-04-20 11:19 ` Rik van Riel
2005-04-20 15:06 ` Chris Friesen
2005-04-20 8:34 ` Miquel van Smoorenburg
2005-04-19 5:57 ` Takashi Ikebe
2005-04-18 14:28 ` Paul Jackson
2005-04-20 13:10 ` Ralf Baechle
2005-04-20 15:08 ` Chris Friesen
2005-04-23 16:17 ` Andi Kleen
2005-04-25 2:11 ` Takashi Ikebe
2005-04-25 2:48 ` Kyle Moffett
2005-04-25 10:39 ` Takashi Ikebe
2005-04-25 11:15 ` Kyle Moffett
2005-04-25 15:09 ` Pavel Machek
2005-04-25 15:54 ` Andi Kleen
2005-04-25 16:36 ` Valdis.Kletnieks
2005-04-26 1:34 ` Takashi Ikebe
2005-04-26 2:15 ` Kyle Moffett
2005-04-26 9:36 ` Pavel Machek
2005-04-26 13:05 ` Andi Kleen
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=42D28E2B.7050707@cosmosbay.com \
--to=dada1@cosmosbay.com \
--cc=a.p.zijlstra@chello.nl \
--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