diff options
| author | Andrew Morton <akpm@digeo.com> | 2003-01-10 18:39:36 -0800 |
|---|---|---|
| committer | Richard Henderson <rth@are.twiddle.net> | 2003-01-10 18:39:36 -0800 |
| commit | d9be9136602e3decfd7a0375725a8eba1c5079ec (patch) | |
| tree | d779526ac68a528c5102fcf9188f83ae49b63ef0 /kernel | |
| parent | b473e48bf88f8a8b4a34c9be9cd9e0e379520cf3 (diff) | |
[PATCH] turn i_shared_lock into a semaphore
i_shared_lock is held for a very long time during vmtruncate() and causes
high scheduling latencies when truncating a file which is mmapped. I've seen
100 milliseconds.
So turn it into a semaphore. It nests inside mmap_sem.
This change is also needed by the shared pagetable patch, which needs to
unshare pte's on the vmtruncate path - lots of pagetable pages need to
be allocated and they are using __GFP_WAIT.
The patch also makes unmap_vma() static.
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/fork.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index b8fcbbc1862a..115a5eae0d6b 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -262,9 +262,9 @@ static inline int dup_mmap(struct mm_struct * mm, struct mm_struct * oldmm) atomic_dec(&inode->i_writecount); /* insert tmp into the share list, just after mpnt */ - spin_lock(&inode->i_mapping->i_shared_lock); + down(&inode->i_mapping->i_shared_sem); list_add_tail(&tmp->shared, &mpnt->shared); - spin_unlock(&inode->i_mapping->i_shared_lock); + up(&inode->i_mapping->i_shared_sem); } /* |
