diff options
| author | Andrew Morton <akpm@digeo.com> | 2003-04-12 12:56:37 -0700 |
|---|---|---|
| committer | James Bottomley <jejb@raven.il.steeleye.com> | 2003-04-12 12:56:37 -0700 |
| commit | a413a276a079b9a8f125f921e055b908b95f8251 (patch) | |
| tree | 19263efb786a990b31e70e93654a0db73fd45432 /include/linux | |
| parent | 300c26525d4d64338c61d8f2fc776370afc534d6 (diff) | |
[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
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/file.h | 2 | ||||
| -rw-r--r-- | include/linux/init_task.h | 2 |
2 files changed, 2 insertions, 2 deletions
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, \ |
