kernel: invlpg facility

. only use for single-page invalidations initially
	. shows tiny but statistically significant performance
	  improvement; will be more helpful in certain VM debug
	  modes
This commit is contained in:
Ben Gras
2011-08-01 15:35:34 +02:00
parent 55c6f3f507
commit 35cc7fbeb8
4 changed files with 23 additions and 4 deletions

View File

@@ -333,8 +333,8 @@ PUBLIC void *vm_allocpage(phys_bytes *phys, int reason)
return NULL;
}
if((r=sys_vmctl(SELF, VMCTL_FLUSHTLB, 0)) != OK) {
panic("VMCTL_FLUSHTLB failed: %d", r);
if((r=sys_vmctl(SELF, VMCTL_I386_INVLPG, loc)) != OK) {
panic("VMCTL_I386_INVLPG failed: %d", r);
}
level--;
@@ -370,8 +370,8 @@ PUBLIC void vm_pagelock(void *vir, int lockflag)
panic("vm_lockpage: pt_writemap failed");
}
if((r=sys_vmctl(SELF, VMCTL_FLUSHTLB, 0)) != OK) {
panic("VMCTL_FLUSHTLB failed: %d", r);
if((r=sys_vmctl(SELF, VMCTL_I386_INVLPG, m)) != OK) {
panic("VMCTL_I386_INVLPG failed: %d", r);
}
return;