Re: Witness warning with SCTP

From: Robert Watson <rwatson_at_FreeBSD.org>
Date: Wed, 10 Jan 2007 14:22:56 +0000 (GMT)
On Tue, 9 Jan 2007, John Baldwin wrote:

> Either that or use an sx lock to close the pcb alloc race instead and don't 
> hold mutexes while calling hashinit().

I think this is a good point -- I've generally been restructuring PCB init 
functions so that they perform allocation up front before acquiring locks in 
order to reduce lock contention on the table locks, which are global and 
acquired in many other paths.  This tends to simplify error handling also. 
I'm not sure how well that applies in this case, however.  Certainly, we want 
to optimize for successful handling, since malloc(9) failure is very unusual 
and occurs only in very exceptional (and unfortunate) cases.  A more likely 
failure is the exhaustion of the zone limit on the pcb zone, which gates the 
overall allocation of memory for the socket type, and should be the first 
memory type allocated when setting up pcbs for this reason.

Robert N M Watson
Computer Laboratory
University of Cambridge
Received on Wed Jan 10 2007 - 13:22:58 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:04 UTC