linux-IllusionX/kernel
Dipankar Sarma 529bf6be5c [PATCH] fix file counting
I have benchmarked this on an x86_64 NUMA system and see no significant
performance difference on kernbench.  Tested on both x86_64 and powerpc.

The way we do file struct accounting is not very suitable for batched
freeing.  For scalability reasons, file accounting was
constructor/destructor based.  This meant that nr_files was decremented
only when the object was removed from the slab cache.  This is susceptible
to slab fragmentation.  With RCU based file structure, consequent batched
freeing and a test program like Serge's, we just speed this up and end up
with a very fragmented slab -

llm22:~ # cat /proc/sys/fs/file-nr
587730  0       758844

At the same time, I see only a 2000+ objects in filp cache.  The following
patch I fixes this problem.

This patch changes the file counting by removing the filp_count_lock.
Instead we use a separate percpu counter, nr_files, for now and all
accesses to it are through get_nr_files() api.  In the sysctl handler for
nr_files, we populate files_stat.nr_files before returning to user.

Counting files as an when they are created and destroyed (as opposed to
inside slab) allows us to correctly count open files with RCU.

Signed-off-by: Dipankar Sarma <dipankar@in.ibm.com>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-08 14:14:01 -08:00
..
irq
power [PATCH] swsusp: fix breakage with swap on LVM 2006-02-17 13:59:27 -08:00
.gitignore
acct.c
audit.c
auditsc.c [PATCH] GFP_KERNEL allocations in atomic (auditsc) 2006-02-18 15:41:50 -05:00
capability.c
compat.c
configs.c
cpu.c
cpuset.c [PATCH] cpuset: oops in exit on null cpuset fix 2006-02-15 15:32:21 -08:00
dma.c
exec_domain.c
exit.c [PATCH] kjournald keeps reference to namespace 2006-02-20 20:27:38 -08:00
extable.c
fork.c [PATCH] fix kill_proc_info() vs fork() theoretical race 2006-02-15 10:21:24 -08:00
futex.c
hrtimer.c [PATCH] fix next_timer_interrupt() for hrtimer 2006-03-06 18:40:44 -08:00
intermodule.c
itimer.c
kallsyms.c
Kconfig.hz
Kconfig.preempt
kexec.c
kfifo.c
kmod.c
kprobes.c
ksysfs.c
kthread.c
Makefile
module.c
mutex-debug.c
mutex-debug.h
mutex.c
mutex.h
panic.c [PATCH] prevent recursive panic from softlockup watchdog 2006-02-10 08:13:12 -08:00
params.c
pid.c
posix-cpu-timers.c
posix-timers.c
printk.c
profile.c
ptrace.c [PATCH] fix zap_thread's ptrace related problems 2006-02-15 11:05:43 -08:00
rcupdate.c [PATCH] rcu batch tuning 2006-03-08 14:14:01 -08:00
rcutorture.c
resource.c
sched.c [PATCH] idle threads should have a sane ->timestamp value 2006-03-08 14:14:00 -08:00
seccomp.c
signal.c
softirq.c
softlockup.c
spinlock.c
stop_machine.c
sys.c
sys_ni.c [PATCH] Fix compile for CONFIG_SYSVIPC=n or CONFIG_SYSCTL=n 2006-02-20 20:00:11 -08:00
sysctl.c [PATCH] fix file counting 2006-03-08 14:14:01 -08:00
time.c
timer.c [PATCH] time: add barrier after updating jiffies_64 2006-03-06 18:40:44 -08:00
uid16.c
user.c
wait.c
workqueue.c