Remove the zone limits for all the zones used in the ATM code.

These were a left over from when the private memory pools were
converted to use uma zones. The limit of UMA zones, however,
works differently. When a zone is limited to only one or two pages
than, on multi-cpu systems, processes can get stuck on the zonelimit,
because all remaining free items are in caches of other CPUs.

Also add rudimentary error handling in some places (panic) when a zone
cannot be created.
This commit is contained in:
Hartmut Brandt 2003-07-22 12:46:30 +00:00
parent 77bf7b3bc0
commit b92ba02261
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=117886
13 changed files with 14 additions and 21 deletions

View File

@ -105,11 +105,13 @@ atm_cm_init(void)
atm_connection_zone = uma_zcreate("atm connection",
sizeof(Atm_connection), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
uma_zone_set_max(atm_connection_zone, 100);
if (atm_connection_zone == NULL)
panic("atm_connection_zone");
atm_connvc_zone = uma_zcreate("atm connvc", sizeof(Atm_connvc), NULL,
NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
uma_zone_set_max(atm_connvc_zone, 100);
if (atm_connvc_zone == NULL)
panic("atm_connvc_zone");
}
/*

View File

@ -78,7 +78,6 @@ atm_sock_init(void)
NULL, NULL, UMA_ALIGN_PTR, 0);
if (atm_pcb_zone == NULL)
panic("atm_sock_init: unable to initialize atm_pcb_zone");
uma_zone_set_max(atm_pcb_zone, 100);
}
/*

View File

@ -114,13 +114,11 @@ atm_initialize()
UMA_ALIGN_PTR, 0);
if (atm_attributes_zone == NULL)
panic("atm_initialize: unable to create attributes zone");
uma_zone_set_max(atm_attributes_zone, 100);
atm_stackq_zone = uma_zcreate("atm stackq", sizeof(struct stackq_entry),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
if (atm_stackq_zone == NULL)
panic("atm_initialize: unable to create stackq zone");
uma_zone_set_max(atm_stackq_zone, 10);
atm_intrq.ifq_maxlen = ATM_INTRQ_MAX;
mtx_init(&atm_intrq.ifq_mtx, "atm_inq", NULL, MTX_DEF);

View File

@ -402,13 +402,11 @@ ipatm_start()
NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
if (ipatm_vc_zone == NULL)
panic("ipatm_start: unable to create ipatm_vc_zone");
uma_zone_set_max(ipatm_vc_zone, 100);
ipatm_nif_zone = uma_zcreate("ipatm nif", sizeof(struct ip_nif), NULL,
NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
if (ipatm_nif_zone == NULL)
panic("ipatm_start: unable to create ipatm_nif_zone");
uma_zone_set_max(ipatm_nif_zone, 52);
/*
* Register ourselves as a network convergence module

View File

@ -145,7 +145,8 @@ sigpvc_start()
sigpvc_vc_zone = uma_zcreate("sigpvc vc", sizeof(struct sigpvc_vccb),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
uma_zone_set_max(sigpvc_vc_zone, 50);
if (sigpvc_vc_zone == NULL)
return (ENOMEM);
/*
* Register ourselves with system

View File

@ -365,7 +365,8 @@ spansarp_start()
spansarp_zone = uma_zcreate("spansarp", sizeof(struct spansarp),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
uma_zone_set_max(spansarp_zone, 100);
if (spansarp_zone == NULL)
panic("spansarp_zone");
}
/*

View File

@ -250,7 +250,8 @@ spanscls_start()
spanscls_zone = uma_zcreate("spanscls", sizeof(struct spanscls),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
uma_zone_set_max(spanscls_zone, 100);
if (spanscls_zone == NULL)
panic("spanscls_zone");
/*
* Fill in union fields

View File

@ -126,11 +126,13 @@ spans_start()
spans_vc_zone = uma_zcreate("spans vc", sizeof(struct spans_vccb),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
uma_zone_set_max(spans_vc_zone, 50);
if (spans_vc_zone == NULL)
panic("spans_vc_zone");
spans_msg_zone = uma_zcreate("spans msg", sizeof(spans_msg), NULL,
NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
uma_zone_set_max(spans_msg_zone, 50);
if (spans_msg_zone == NULL)
panic("spans_msg_zone");
/*
* Allocate protocol definition structure

View File

@ -117,8 +117,6 @@ sscf_uni_start()
if (sscf_uni_zone == NULL)
panic("sscf_uni_start: uma_zcreate");
uma_zone_set_max(sscf_uni_zone, 100);
/*
* Register stack service
*/

View File

@ -152,7 +152,6 @@ sscop_start()
NULL, NULL, UMA_ALIGN_PTR, 0);
if (sscop_zone == NULL)
panic("sscop_start: uma_zcreate");
uma_zone_set_max(sscop_zone, 100);
/*
* Register stack service

View File

@ -126,7 +126,6 @@ uniarp_start()
NULL, NULL, UMA_ALIGN_PTR, 0);
if (uniarp_zone == NULL)
panic("uniarp_start: uma_zcreate");
uma_zone_set_max(uniarp_zone, 200);
/*
* Register our endpoint

View File

@ -105,7 +105,6 @@ uniip_start()
NULL, NULL, UMA_ALIGN_PTR, 0);
if (uniip_zone == NULL)
panic("uniip_start: uma_zcreate");
uma_zone_set_max(uniip_zone, 100);
/*
* Tell arp to initialize stuff

View File

@ -169,10 +169,6 @@ unisig_start()
if (unisig_ie_zone == NULL)
panic("unisig_start: uma_zcreate failed to create ie zone");
uma_zone_set_max(unisig_vc_zone, 50);
uma_zone_set_max(unisig_msg_zone, 50);
uma_zone_set_max(unisig_ie_zone, 50);
/*
* Register ourselves with system
*/