aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mm.h
diff options
context:
space:
mode:
authorHugh Dickins <hugh@veritas.com>2005-10-29 21:16:33 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-30 00:40:41 -0400
commitdeceb6cd17e6dfafe4c4f81b1b4153bc41b2cb70 (patch)
tree2a722f50e8edef8609a49f65bfcb222e499c44cc /include/linux/mm.h
parentc34d1b4d165c67b966bca4aba026443d7ff161eb (diff)
[PATCH] mm: follow_page with inner ptlock
Final step in pushing down common core's page_table_lock. follow_page no longer wants caller to hold page_table_lock, uses pte_offset_map_lock itself; and so no page_table_lock is taken in get_user_pages itself. But get_user_pages (and get_futex_key) do then need follow_page to pin the page for them: take Daniel's suggestion of bitflags to follow_page. Need one for WRITE, another for TOUCH (it was the accessed flag before: vanished along with check_user_page_readable, but surely get_numa_maps is wrong to mark every page it finds as accessed), another for GET. And another, ANON to dispose of untouched_anonymous_page: it seems silly for that to descend a second time, let follow_page observe if there was no page table and return ZERO_PAGE if so. Fix minor bug in that: check VM_LOCKED - make_pages_present ought to make readonly anonymous present. Give get_numa_maps a cond_resched while we're there. Signed-off-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r--include/linux/mm.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index aa8de20e2e80..e8d1424153bb 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -938,14 +938,18 @@ static inline unsigned long vma_pages(struct vm_area_struct *vma)
938 return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; 938 return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
939} 939}
940 940
941extern struct vm_area_struct *find_extend_vma(struct mm_struct *mm, unsigned long addr); 941struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr);
942 942struct page *vmalloc_to_page(void *addr);
943extern struct page * vmalloc_to_page(void *addr); 943unsigned long vmalloc_to_pfn(void *addr);
944extern unsigned long vmalloc_to_pfn(void *addr); 944int remap_pfn_range(struct vm_area_struct *, unsigned long addr,
945extern struct page * follow_page(struct mm_struct *mm, unsigned long address, 945 unsigned long pfn, unsigned long size, pgprot_t);
946 int write); 946
947int remap_pfn_range(struct vm_area_struct *, unsigned long, 947struct page *follow_page(struct mm_struct *, unsigned long address,
948 unsigned long, unsigned long, pgprot_t); 948 unsigned int foll_flags);
949#define FOLL_WRITE 0x01 /* check pte is writable */
950#define FOLL_TOUCH 0x02 /* mark page accessed */
951#define FOLL_GET 0x04 /* do get_page on page */
952#define FOLL_ANON 0x08 /* give ZERO_PAGE if no pgtable */
949 953
950#ifdef CONFIG_PROC_FS 954#ifdef CONFIG_PROC_FS
951void vm_stat_account(struct mm_struct *, unsigned long, struct file *, long); 955void vm_stat_account(struct mm_struct *, unsigned long, struct file *, long);