From: Manfred Spraul <manfred@colorfullife.com>
To: linux-kernel@vger.kernel.org
Cc: ak@suse.de
Subject: optimize DNAME_INLINE_LEN
Date: Thu, 13 Dec 2001 23:22:47 +0100 [thread overview]
Message-ID: <3C192A37.4547D2A7@colorfullife.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 499 bytes --]
The dcache entries are allocated with SLAB_HWCACHE_ALIGN. For better
memory usage, we should increase DNAME_INLINE_LEN so that sizeof(struct
dentry) becomes a multiple of the L1 cache line size.
On i386 the DNAME_INLINE_LEN becomes 36 bytes instead of 16, which saves
thousands of kmallocs for external file names. (12818 on my debug
system, after updatedb)
The attached patch is preliminary, it doesn't compile with egcs-1.1.2.
Which gcc version added support for unnamed structures?
--
Manfred
[-- Attachment #2: patch-dcache --]
[-- Type: text/plain, Size: 742 bytes --]
--- 2.5/include/linux/dcache.h Thu Oct 11 15:20:18 2001
+++ build-2.5/include/linux/dcache.h Thu Dec 13 22:55:50 2001
@@ -61,9 +61,7 @@
return end_name_hash(hash);
}
-#define DNAME_INLINE_LEN 16
-
-struct dentry {
+struct dentry_nameless {
atomic_t d_count;
unsigned int d_flags;
struct inode * d_inode; /* Where the name belongs to - NULL is negative */
@@ -80,6 +78,12 @@
struct super_block * d_sb; /* The root of the dentry tree */
unsigned long d_vfs_flags;
void * d_fsdata; /* fs-specific data */
+};
+#define DNAME_INLINE_LEN \
+ (16 + L1_CACHE_BYTES - (16+sizeof(struct dentry_nameless))%L1_CACHE_BYTES)
+
+struct dentry {
+ struct dentry_nameless;
unsigned char d_iname[DNAME_INLINE_LEN]; /* small names */
};
next reply other threads:[~2001-12-13 22:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-13 22:22 Manfred Spraul [this message]
2001-12-13 23:07 ` optimize DNAME_INLINE_LEN Andreas Dilger
2001-12-13 23:24 ` Manfred Spraul
2001-12-13 23:29 ` Andi Kleen
2001-12-14 0:03 ` Andreas Dilger
2001-12-14 0:10 ` 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=3C192A37.4547D2A7@colorfullife.com \
--to=manfred@colorfullife.com \
--cc=ak@suse.de \
--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