From ef209971e9aaeefde0d7caa90efcb5343aaf3fe0 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Mon, 29 Aug 2016 14:38:31 +0000 Subject: [PATCH] Shorten banal comments about zeroing and copying pages. Don't give implementation details that last echoed the code 15-20 years ago. But add a detail about pagezero() on i386. Switch from Mach style to BSD style. --- sys/amd64/amd64/pmap.c | 21 +++++++-------------- sys/i386/i386/pmap.c | 24 ++++++++++-------------- 2 files changed, 17 insertions(+), 28 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 3cb85301e93f..104815908bc2 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -5153,8 +5153,7 @@ out: } /* - * pmap_zero_page zeros the specified hardware page by mapping - * the page into KVM and using bzero to clear its contents. + * Zero the specified hardware page. */ void pmap_zero_page(vm_page_t m) @@ -5165,10 +5164,8 @@ pmap_zero_page(vm_page_t m) } /* - * pmap_zero_page_area zeros the specified hardware page by mapping - * the page into KVM and using bzero to clear its contents. - * - * off and size may not cover an area beyond a single hardware page. + * Zero an an area within a single hardware page. off and size must not + * cover an area beyond a single hardware page. */ void pmap_zero_page_area(vm_page_t m, int off, int size) @@ -5182,10 +5179,9 @@ pmap_zero_page_area(vm_page_t m, int off, int size) } /* - * pmap_zero_page_idle zeros the specified hardware page by mapping - * the page into KVM and using bzero to clear its contents. This - * is intended to be called from the vm_pagezero process only and - * outside of Giant. + * Zero the specified hardware page in a way that minimizes cache thrashing. + * This is intended to be called from the vm_pagezero process only and + * outside of Giant. */ void pmap_zero_page_idle(vm_page_t m) @@ -5196,10 +5192,7 @@ pmap_zero_page_idle(vm_page_t m) } /* - * pmap_copy_page copies the specified (machine independent) - * page by mapping the page into virtual memory and using - * bcopy to copy the page, one machine dependent page at a - * time. + * Copy 1 specified hardware page to another. */ void pmap_copy_page(vm_page_t msrc, vm_page_t mdst) diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index d40de0ff8b10..d08c28babc00 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -4174,6 +4174,9 @@ out: PMAP_UNLOCK(dst_pmap); } +/* + * Zero 1 page of virtual memory mapped from a hardware page by the caller. + */ static __inline void pagezero(void *page) { @@ -4191,8 +4194,7 @@ pagezero(void *page) } /* - * pmap_zero_page zeros the specified hardware page by mapping - * the page into KVM and using bzero to clear its contents. + * Zero the specified hardware page. */ void pmap_zero_page(vm_page_t m) @@ -4214,10 +4216,8 @@ pmap_zero_page(vm_page_t m) } /* - * pmap_zero_page_area zeros the specified hardware page by mapping - * the page into KVM and using bzero to clear its contents. - * - * off and size may not cover an area beyond a single hardware page. + * Zero an an area within a single hardware page. off and size must not + * cover an area beyond a single hardware page. */ void pmap_zero_page_area(vm_page_t m, int off, int size) @@ -4242,10 +4242,9 @@ pmap_zero_page_area(vm_page_t m, int off, int size) } /* - * pmap_zero_page_idle zeros the specified hardware page by mapping - * the page into KVM and using bzero to clear its contents. This - * is intended to be called from the vm_pagezero process only and - * outside of Giant. + * Zero the specified hardware page in a way that minimizes cache thrashing. + * This is intended to be called from the vm_pagezero process only and + * outside of Giant. */ void pmap_zero_page_idle(vm_page_t m) @@ -4263,10 +4262,7 @@ pmap_zero_page_idle(vm_page_t m) } /* - * pmap_copy_page copies the specified (machine independent) - * page by mapping the page into virtual memory and using - * bcopy to copy the page, one machine dependent page at a - * time. + * Copy 1 specified hardware page to another. */ void pmap_copy_page(vm_page_t src, vm_page_t dst)