mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-02 08:42:48 +00: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. MFC after: 2 weeks Sponsored by: Axcient Reviewed by: phk Differential Revision: https://reviews.freebsd.org/D29047
This commit is contained in:
parent
63749bfe96
commit
f05b724ecb
@ -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 New Issue
Block a user