diff options
| author | Linus Torvalds <torvalds@athlon.transmeta.com> | 2002-02-04 18:03:57 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@athlon.transmeta.com> | 2002-02-04 18:03:57 -0800 |
| commit | cc80f8f99c1ba16d54b0af64cb3911cd0146259e (patch) | |
| tree | bc033080018817d4095c2891c76e9c19c68c83bd /include/linux | |
| parent | 8565fe850b04acbfdc4c24cdcafeed359bb0f2b3 (diff) | |
v2.4.2.4 -> v2.4.2.5
- Rik van Riel and others: mm rw-semaphore (ps/top ok when swapping)
- IDE: 256 sectors at a time is legal, but apparently confuses some
drives. Max out at 255 sectors instead.
- Petko Manolov: USB pegasus driver update
- make the boottime memory map printout at least almost readable.
- USB driver updates
- pte_alloc()/pmd_alloc() need page_table_lock.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/fs_struct.h | 2 | ||||
| -rw-r--r-- | include/linux/mm.h | 16 | ||||
| -rw-r--r-- | include/linux/sched.h | 4 |
3 files changed, 19 insertions, 3 deletions
diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h index 3d2df3cf4202..3d6451977757 100644 --- a/include/linux/fs_struct.h +++ b/include/linux/fs_struct.h @@ -13,7 +13,7 @@ struct fs_struct { #define INIT_FS { \ ATOMIC_INIT(1), \ RW_LOCK_UNLOCKED, \ - 0022, \ + 0000, \ NULL, NULL, NULL, NULL, NULL, NULL \ } diff --git a/include/linux/mm.h b/include/linux/mm.h index 378a8f808c11..86bc813adadc 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -395,12 +395,26 @@ extern int remap_page_range(unsigned long from, unsigned long to, unsigned long extern int zeromap_page_range(unsigned long from, unsigned long size, pgprot_t prot); extern void vmtruncate(struct inode * inode, loff_t offset); +extern pmd_t *FASTCALL(__pmd_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address)); +extern pte_t *FASTCALL(pte_alloc(struct mm_struct *mm, pmd_t *pmd, unsigned long address)); extern int handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, unsigned long address, int write_access); extern int make_pages_present(unsigned long addr, unsigned long end); extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char *dst, int len); extern int ptrace_writedata(struct task_struct *tsk, char * src, unsigned long dst, int len); +/* + * On a two-level page table, this ends up being trivial. Thus the + * inlining and the symmetry break with pte_alloc() that does all + * of this out-of-line. + */ +static inline pmd_t *pmd_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address) +{ + if (!pgd_present(*pgd)) + return __pmd_alloc(mm, pgd, address); + return pmd_offset(pgd, address); +} + extern int pgt_cache_water[2]; extern int check_pgt_cache(void); @@ -492,11 +506,13 @@ static inline int expand_stack(struct vm_area_struct * vma, unsigned long addres if (vma->vm_end - address > current->rlim[RLIMIT_STACK].rlim_cur || ((vma->vm_mm->total_vm + grow) << PAGE_SHIFT) > current->rlim[RLIMIT_AS].rlim_cur) return -ENOMEM; + spin_lock(&vma->vm_mm->page_table_lock); vma->vm_start = address; vma->vm_pgoff -= grow; vma->vm_mm->total_vm += grow; if (vma->vm_flags & VM_LOCKED) vma->vm_mm->locked_vm += grow; + spin_unlock(&vma->vm_mm->page_table_lock); return 0; } diff --git a/include/linux/sched.h b/include/linux/sched.h index 4186c24aa34c..f4b57389330f 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -208,7 +208,7 @@ struct mm_struct { atomic_t mm_users; /* How many users with user space? */ atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */ int map_count; /* number of VMAs */ - struct semaphore mmap_sem; + struct rw_semaphore mmap_sem; spinlock_t page_table_lock; struct list_head mmlist; /* List of all active mm's */ @@ -236,7 +236,7 @@ extern int mmlist_nr; mm_users: ATOMIC_INIT(2), \ mm_count: ATOMIC_INIT(1), \ map_count: 1, \ - mmap_sem: __MUTEX_INITIALIZER(name.mmap_sem), \ + mmap_sem: __RWSEM_INITIALIZER(name.mmap_sem, RW_LOCK_BIAS), \ page_table_lock: SPIN_LOCK_UNLOCKED, \ mmlist: LIST_HEAD_INIT(name.mmlist), \ } |
