From a413a276a079b9a8f125f921e055b908b95f8251 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sat, 12 Apr 2003 12:56:37 -0700 Subject: [PATCH] convert file_lock to a spinlock Time to write a 2M file, one byte at a time: Before: 1.09s user 4.92s system 99% cpu 6.014 total 0.74s user 5.28s system 99% cpu 6.023 total 1.03s user 4.97s system 100% cpu 5.991 total After: 0.79s user 5.17s system 99% cpu 5.993 total 0.79s user 5.17s system 100% cpu 5.957 total 0.84s user 5.11s system 100% cpu 5.942 total --- include/linux/file.h | 2 +- include/linux/init_task.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include/linux') diff --git a/include/linux/file.h b/include/linux/file.h index 0bfe318d873b..6fbd27f755d5 100644 --- a/include/linux/file.h +++ b/include/linux/file.h @@ -21,7 +21,7 @@ */ struct files_struct { atomic_t count; - rwlock_t file_lock; /* Protects all the below members. Nests inside tsk->alloc_lock */ + spinlock_t file_lock; /* Protects all the below members. Nests inside tsk->alloc_lock */ int max_fds; int max_fdset; int next_fd; diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 6e749b6c5a7f..96a5f926300e 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h @@ -6,7 +6,7 @@ #define INIT_FILES \ { \ .count = ATOMIC_INIT(1), \ - .file_lock = RW_LOCK_UNLOCKED, \ + .file_lock = SPIN_LOCK_UNLOCKED, \ .max_fds = NR_OPEN_DEFAULT, \ .max_fdset = __FD_SETSIZE, \ .next_fd = 0, \ -- cgit v1.2.3