mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 09:41:03 -04:00
Modernize geom_stats_snapshot_get
* A logically useless memset() is used to fault in some memory pages.
Change it to explicit_bzero so the compiler won't eliminate it.
* Eliminate the second memset. It made sense in the days of the Big
Kernel Lock, but not in the days of fine-grained SMP and especially
not in the days of VDSO.
Sponsored by: Axcient
Reviewed by: phk
Differential Revision: https://reviews.freebsd.org/D29047
(cherry picked from commit f05b724ecb)
This commit is contained in:
parent
438e52f814
commit
774abe650b
1 changed files with 1 additions and 2 deletions
|
|
@ -136,9 +136,8 @@ geom_stats_snapshot_get(void)
|
|||
free(sp);
|
||||
return (NULL);
|
||||
}
|
||||
memset(sp->ptr, 0, pagesize * npages); /* page in, cache */
|
||||
explicit_bzero(sp->ptr, pagesize * npages); /* page in, cache */
|
||||
clock_gettime(CLOCK_REALTIME, &sp->time);
|
||||
memset(sp->ptr, 0, pagesize * npages); /* page in, cache */
|
||||
memcpy(sp->ptr, statp, pagesize * npages);
|
||||
sp->pages = npages;
|
||||
sp->perpage = spp;
|
||||
|
|
|
|||
Loading…
Reference in a new issue