From 7c2149e943bf3fae3e6e14189463390ef4c5b7a1 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Thu, 26 Sep 2002 22:43:29 -0700 Subject: [PATCH] virtual => physical page mapping cache Implement a "mapping change" notification for virtual lookup caches, and make the futex code use that to keep the futex page pinning consistent across copy-on-write events in the VM space. --- include/linux/futex.h | 2 +- include/linux/mm.h | 1 + include/linux/vcache.h | 26 ++++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 include/linux/vcache.h (limited to 'include/linux') diff --git a/include/linux/futex.h b/include/linux/futex.h index 1b9a8f7ad5e8..415946df03d4 100644 --- a/include/linux/futex.h +++ b/include/linux/futex.h @@ -6,6 +6,6 @@ #define FUTEX_WAKE (1) #define FUTEX_FD (2) -extern asmlinkage int sys_futex(void *uaddr, int op, int val, struct timespec *utime); +extern asmlinkage int sys_futex(unsigned long uaddr, int op, int val, struct timespec *utime); #endif diff --git a/include/linux/mm.h b/include/linux/mm.h index 482db998aca7..4ae8eb10dcb2 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -374,6 +374,7 @@ extern int handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, unsi 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 struct page * follow_page(struct mm_struct *mm, unsigned long address, int write); int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, int len, int write, int force, struct page **pages, struct vm_area_struct **vmas); diff --git a/include/linux/vcache.h b/include/linux/vcache.h new file mode 100644 index 000000000000..d5756643332c --- /dev/null +++ b/include/linux/vcache.h @@ -0,0 +1,26 @@ +/* + * virtual => physical mapping cache support. + */ +#ifndef _LINUX_VCACHE_H +#define _LINUX_VCACHE_H + +typedef struct vcache_s { + unsigned long address; + struct mm_struct *mm; + struct list_head hash_entry; + void (*callback)(struct vcache_s *data, struct page *new_page); +} vcache_t; + +extern spinlock_t vcache_lock; + +extern void __attach_vcache(vcache_t *vcache, + unsigned long address, + struct mm_struct *mm, + void (*callback)(struct vcache_s *data, struct page *new_page)); + +extern void detach_vcache(vcache_t *vcache); + +extern void invalidate_vcache(unsigned long address, struct mm_struct *mm, + struct page *new_page); + +#endif -- cgit v1.2.3