From d9be9136602e3decfd7a0375725a8eba1c5079ec Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Fri, 10 Jan 2003 18:39:36 -0800 Subject: [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. --- include/linux/fs.h | 2 +- include/linux/mm.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'include/linux') diff --git a/include/linux/fs.h b/include/linux/fs.h index 821034d8745b..3d098c717fc1 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -319,7 +319,7 @@ struct address_space { struct address_space_operations *a_ops; /* methods */ struct list_head i_mmap; /* list of private mappings */ struct list_head i_mmap_shared; /* list of private mappings */ - spinlock_t i_shared_lock; /* and spinlock protecting it */ + struct semaphore i_shared_sem; /* and sem protecting it */ unsigned long dirtied_when; /* jiffies of first page dirtying */ int gfp_mask; /* how to allocate the pages */ struct backing_dev_info *backing_dev_info; /* device readahead, etc */ diff --git a/include/linux/mm.h b/include/linux/mm.h index 70177c796b12..554af98ab3b6 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -529,7 +529,6 @@ extern struct vm_area_struct * find_vma_prev(struct mm_struct * mm, unsigned lon struct vm_area_struct **pprev); extern int split_vma(struct mm_struct * mm, struct vm_area_struct * vma, unsigned long addr, int new_below); -extern void unmap_vma(struct mm_struct *mm, struct vm_area_struct *area); /* Look up the first VMA which intersects the interval start_addr..end_addr-1, NULL if none. Assume start_addr < end_addr. */ -- cgit v1.2.3