diff options
author | tegge <tegge@FreeBSD.org> | 2001-10-14 20:56:55 +0000 |
---|---|---|
committer | tegge <tegge@FreeBSD.org> | 2001-10-14 20:56:55 +0000 |
commit | 6cedacbbd09dfe25cf667dac785b86c1a404cfdf (patch) | |
tree | 1098a29ec402a2f58b9ad95da0d0af8daca7d76e /sys/amd64 | |
parent | a9bfe7a4b3a7951f08960288f53ed37cee271817 (diff) | |
download | FreeBSD-src-6cedacbbd09dfe25cf667dac785b86c1a404cfdf.zip FreeBSD-src-6cedacbbd09dfe25cf667dac785b86c1a404cfdf.tar.gz |
Reduce the number of TLB shootdowns caused by a call to pmap_qenter()
from number of pages mapped to 1.
Reviewed by: dillon
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/pmap.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index b41b11f..5912074 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -767,12 +767,26 @@ pmap_qenter(va, m, count) vm_page_t *m; int count; { - int i; + vm_offset_t end_va; + + end_va = va + count * PAGE_SIZE; + + while (va < end_va) { + unsigned *pte; - for (i = 0; i < count; i++) { - vm_offset_t tva = va + i * PAGE_SIZE; - pmap_kenter(tva, VM_PAGE_TO_PHYS(m[i])); + pte = (unsigned *)vtopte(va); + *pte = VM_PAGE_TO_PHYS(*m) | PG_RW | PG_V | pgeflag; +#ifdef SMP + cpu_invlpg((void *)va); +#else + invltlb_1pg(va); +#endif + va += PAGE_SIZE; + m++; } +#ifdef SMP + smp_invltlb(); +#endif } /* |