1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

Redo the previous fix by setting the UMA_ZONE_ZINIT bit in the syncache

zone, eliminating the need to call bzero() after each syncache entry
allocation.

Suggested by:	glebius
Reviewed by:	andre
MFC after:	3 days
This commit is contained in:
Qing Li 2006-02-08 23:32:57 +00:00
parent d9a7dc858a
commit c1fd993af9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=155463

View File

@ -255,7 +255,8 @@ syncache_init(void)
* older one.
*/
tcp_syncache.zone = uma_zcreate("syncache", sizeof(struct syncache),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR,
UMA_ZONE_NOFREE | UMA_ZONE_ZINIT);
uma_zone_set_max(tcp_syncache.zone, tcp_syncache.cache_limit);
tcp_syncache.cache_limit -= 1;
}
@ -915,7 +916,6 @@ syncache_add(inc, to, th, sop, m)
/*
* Fill in the syncache values.
*/
bzero(sc, sizeof(*sc));
sc->sc_tp = tp;
sc->sc_inp_gencnt = tp->t_inpcb->inp_gencnt;
sc->sc_ipopts = ipopts;
@ -1386,7 +1386,6 @@ syncookie_lookup(inc, th, so)
* Fill in the syncache values.
* XXX duplicate code from syncache_add
*/
bzero(sc, sizeof(*sc));
sc->sc_ipopts = NULL;
sc->sc_inc.inc_fport = inc->inc_fport;
sc->sc_inc.inc_lport = inc->inc_lport;