Eliminate gratuitous bzeroing in dbuf_stats_hash_table_data
`dbuf_stats_hash_table_data` can take much longer than it needs to by repeatedly bzeroing its buffer when in fact the buffer only needs to be NULL terminated. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Matt Macy <mmacy@FreeBSD.org> Closes #10993
This commit is contained in:
parent
7ce9da0bea
commit
775afc4dcd
|
@ -134,7 +134,8 @@ dbuf_stats_hash_table_data(char *buf, size_t size, void *data)
|
||||||
|
|
||||||
ASSERT3S(dsh->idx, >=, 0);
|
ASSERT3S(dsh->idx, >=, 0);
|
||||||
ASSERT3S(dsh->idx, <=, h->hash_table_mask);
|
ASSERT3S(dsh->idx, <=, h->hash_table_mask);
|
||||||
memset(buf, 0, size);
|
if (size)
|
||||||
|
buf[0] = 0;
|
||||||
|
|
||||||
mutex_enter(DBUF_HASH_MUTEX(h, dsh->idx));
|
mutex_enter(DBUF_HASH_MUTEX(h, dsh->idx));
|
||||||
for (db = h->hash_table[dsh->idx]; db != NULL; db = db->db_hash_next) {
|
for (db = h->hash_table[dsh->idx]; db != NULL; db = db->db_hash_next) {
|
||||||
|
|
Loading…
Reference in New Issue