* Added "from" address space parameter to vm_swap_address_space()/

arch_vm_aspace_swap().
* The x86 implementation does now maintain a bit mask per
  vm_translation_map_arch_info indicating on which CPUs the address
  space is active. This allows flush_tmap() to avoid ICI for user
  address spaces when the team isn't currently running on any other CPU.
  In this context ICI is relatively expensive, particularly since we map
  most pages via vm_map_page() and therefore invoke flush_tmap() pretty
  much for every single page.
  This optimization speeds up a "hello world" compilation about 20% on
  my machine (KDEBUG turned off, freshly booted), but interestingly it
  has virtually no effect on the "-j2" haiku build time.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27912 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-10-07 21:39:19 +00:00
parent 492c49ba5c
commit 74785e79db
9 changed files with 76 additions and 29 deletions
+2 -1
View File
@@ -27,7 +27,8 @@ status_t arch_vm_init(struct kernel_args *args);
status_t arch_vm_init_post_area(struct kernel_args *args);
status_t arch_vm_init_end(struct kernel_args *args);
status_t arch_vm_init_post_modules(struct kernel_args *args);
void arch_vm_aspace_swap(struct vm_address_space *aspace);
void arch_vm_aspace_swap(struct vm_address_space *from,
struct vm_address_space *to);
bool arch_vm_supports_protection(uint32 protection);
status_t arch_vm_set_memory_type(struct vm_area *area, addr_t physicalBase,
@@ -13,10 +13,11 @@
struct page_directory_entry;
typedef struct vm_translation_map_arch_info {
struct page_directory_entry *pgdir_virt;
struct page_directory_entry *pgdir_phys;
vint32 active_on_cpus;
// mask indicating on which CPUs the map is currently used
int num_invalidate_pages;
addr_t pages_to_invalidate[PAGE_INVALIDATE_CACHE_SIZE];
} vm_translation_map_arch_info;
+1 -1
View File
@@ -34,7 +34,7 @@ struct vm_address_space *vm_get_current_user_address_space(void);
team_id vm_current_user_address_space_id(void);
struct vm_address_space *vm_get_address_space(team_id team);
void vm_put_address_space(struct vm_address_space *aspace);
#define vm_swap_address_space(aspace) arch_vm_aspace_swap(aspace)
#define vm_swap_address_space(from, to) arch_vm_aspace_swap(from, to)
#ifdef __cplusplus
}