linux-stable/drivers
Eric Dumazet 5160ee6fc8 [PATCH] shrink dentry struct
Some long time ago, dentry struct was carefully tuned so that on 32 bits
UP, sizeof(struct dentry) was exactly 128, ie a power of 2, and a multiple
of memory cache lines.

Then RCU was added and dentry struct enlarged by two pointers, with nice
results for SMP, but not so good on UP, because breaking the above tuning
(128 + 8 = 136 bytes)

This patch reverts this unwanted side effect, by using an union (d_u),
where d_rcu and d_child are placed so that these two fields can share their
memory needs.

At the time d_free() is called (and d_rcu is really used), d_child is known
to be empty and not touched by the dentry freeing.

Lockless lookups only access d_name, d_parent, d_lock, d_op, d_flags (so
the previous content of d_child is not needed if said dentry was unhashed
but still accessed by a CPU because of RCU constraints)

As dentry cache easily contains millions of entries, a size reduction is
worth the extra complexity of the ugly C union.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Cc: Dipankar Sarma <dipankar@in.ibm.com>
Cc: Maneesh Soni <maneesh@in.ibm.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Cc: Ian Kent <raven@themaw.net>
Cc: Paul Jackson <pj@sgi.com>
Cc: Al Viro <viro@ftp.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Neil Brown <neilb@cse.unsw.edu.au>
Cc: James Morris <jmorris@namei.org>
Cc: Stephen Smalley <sds@epoch.ncsc.mil>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-08 20:13:58 -08:00
..
acorn [PATCH] Add block_device_operations.getgeo block device method 2006-01-08 20:13:54 -08:00
acpi [PATCH] tpm: add bios measurement log 2006-01-08 20:13:55 -08:00
amba [ARM] Move AMBA bus code to drivers/amba/ 2006-01-07 14:54:15 +00:00
atm [PATCH] frv: fix uninitialised variable in atm nicstar driver 2006-01-08 20:13:38 -08:00
base [PATCH] memhotplug: register_memory should be global 2006-01-06 08:33:22 -08:00
block [PATCH] nbd: remove duplicate assignment 2006-01-08 20:13:54 -08:00
bluetooth [PATCH] pcmcia: add some IDs for ide-cs and dtl1_cs 2006-01-06 00:31:07 +01:00
cdrom [BLOCK] add @uptodate to end_that_request_last() and @error to rq_end_io_fn() 2006-01-06 09:49:03 +01:00
char [PATCH] tpm: add bios measurement log 2006-01-08 20:13:55 -08:00
connector [PATCH] Add timestamp field to process events 2005-12-12 08:57:42 -08:00
cpufreq [CPUFREQ] CPU frequency display in /proc/cpuinfo 2005-12-06 19:35:11 -08:00
crypto
dio
eisa
fc4 [SPARC]: introduce a SPARC Kconfig symbol 2005-12-22 23:09:54 -08:00
firmware [PATCH] dell_rbu: NULL noise removal 2005-12-15 10:04:30 -08:00
hwmon [PATCH] hwmon: it87 use u8 for vrm 2006-01-05 22:16:26 -08:00
i2c [PATCH] IRQ type flags 2006-01-08 20:13:46 -08:00
ide [PATCH] Add block_device_operations.getgeo block device method 2006-01-08 20:13:54 -08:00
ieee1394 [PATCH] don't freeze firewire on suspend. 2006-01-06 08:33:43 -08:00
infiniband [PATCH] fix more missing includes 2006-01-08 20:13:45 -08:00
input [PATCH] IRQ type flags 2006-01-08 20:13:46 -08:00
isdn [PATCH] drivers/isdn/: "extern inline" -> "static inline" 2006-01-08 20:13:48 -08:00
macintosh [PATCH] fix more missing includes 2006-01-08 20:13:45 -08:00
mca
md [PATCH] Add block_device_operations.getgeo block device method 2006-01-08 20:13:54 -08:00
media Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6 2006-01-06 15:25:08 -08:00
message [PATCH] Add block_device_operations.getgeo block device method 2006-01-08 20:13:54 -08:00
mfd [PATCH] IRQ type flags 2006-01-08 20:13:46 -08:00
misc Input: ibmasm - convert to dynamic input_dev allocation 2006-01-07 11:35:05 -05:00
mmc [PATCH] Add block_device_operations.getgeo block device method 2006-01-08 20:13:54 -08:00
mtd [PATCH] Add block_device_operations.getgeo block device method 2006-01-08 20:13:54 -08:00
net [PATCH] IRQ type flags 2006-01-08 20:13:46 -08:00
nubus
oprofile [PATCH] oprofile: Use vmalloc_node() in alloc_cpu_buffers() 2006-01-08 20:13:56 -08:00
parisc [PARISC] Make superio.c initialize before any driver needs it 2005-11-17 16:44:57 -05:00
parport [PATCH] frv: suppress configuration of certain features for FRV 2006-01-08 20:13:36 -08:00
pci [PATCH] fix more missing includes 2006-01-08 20:13:45 -08:00
pcmcia Merge with Linus' kernel. 2006-01-07 14:40:05 +00:00
pnp [PATCH] x86: Fixed pnp bios limits 2006-01-06 08:33:35 -08:00
rapidio [PATCH] fix more missing includes 2006-01-08 20:13:45 -08:00
s390 [PATCH] Add block_device_operations.getgeo block device method 2006-01-08 20:13:54 -08:00
sbus [PATCH] sbus/char/uctrl: missing prototypes and NULL noise removal 2005-12-15 10:01:28 -08:00
scsi [PATCH] Add block_device_operations.getgeo block device method 2006-01-08 20:13:54 -08:00
serial Merge master.kernel.org:/home/rmk/linux-2.6-arm 2006-01-07 10:45:22 -08:00
sh
sn
tc [MIPS] zs.c: Resurrect the deceased zs.c for now. 2005-11-17 16:23:39 +00:00
telephony [PATCH] pcmcia: unify attach, EVENT_CARD_INSERTION handlers into one probe callback 2006-01-06 00:03:24 +01:00
usb [PATCH] shrink dentry struct 2006-01-08 20:13:58 -08:00
video [PATCH] vgacon: Workaround for resize bug in some chipsets 2006-01-08 20:13:51 -08:00
w1 Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6 2006-01-04 18:44:12 -08:00
zorro
Kconfig
Makefile [ARM] Move AMBA bus code to drivers/amba/ 2006-01-07 14:54:15 +00:00