* Mapping a page might actually need memory - since we usually have locks that
interfere with the page thief, we always need to have reserved a page for this upfront. I introduced a function to the vm_translation_map layer that estimates how much pages a mapping might need at maximum. All functions that map a page now call this and reserve the needed pages upfront. It might not be a nice solution, but it works. * The page thief could run into a panic when trying to call vm_cache_release_ref() on a non-existing (NULL) cache. * Also, it will now ignore wired active pages. * There is still a race condition between the page writer and the vnode destruction - writing a page back needs a valid vnode, but that might just have been deleted. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22455 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -30,6 +30,7 @@ typedef struct vm_translation_map_ops {
|
||||
void (*destroy)(vm_translation_map *map);
|
||||
status_t (*lock)(vm_translation_map *map);
|
||||
status_t (*unlock)(vm_translation_map *map);
|
||||
size_t (*map_max_pages_need)(vm_translation_map *map, addr_t start, addr_t end);
|
||||
status_t (*map)(vm_translation_map *map, addr_t va, addr_t pa,
|
||||
uint32 attributes);
|
||||
status_t (*unmap)(vm_translation_map *map, addr_t start, addr_t end);
|
||||
|
||||
Reference in New Issue
Block a user