Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Nov 2012 10:30:07 +0000 (GMT)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Pawel Jakub Dawidek <pjd@FreeBSD.org>
Cc:        freebsd-arch@FreeBSD.org
Subject:   Re: Print a (rate-limited) warning when UMA zone is full.
Message-ID:  <alpine.BSF.2.00.1211291027430.59662@fledge.watson.org>
In-Reply-To: <20121129090147.GB1370@garage.freebsd.pl>
References:  <20121129090147.GB1370@garage.freebsd.pl>

next in thread | previous in thread | raw e-mail | index | archive | help

On Thu, 29 Nov 2012, Pawel Jakub Dawidek wrote:

> I'd like to propose the following patch:
>
> 	http://people.freebsd.org/~pjd/patches/uma_warning.patch
>
> When UMA zone is created, one can add configure a warning that should be 
> printed when UMA zone is full by calling:
>
> 	uma_zone_set_warning(socket_zone,
> 	    "kern.ipc.maxsockets limit exceeded, please see tuning(7).");
>
> It was very easy to find and fix the problem when I saw messages on the 
> console that kern.maxfiles limit is reached, but when I hit 
> kern.ipc.maxsockets limit and started to get ENOBUFS errors it took me a 
> while to figure out what to tune.
>
> This patch allows to configure advice for the use and give him some details 
> in a very easy way. The warning printed on the console is rate-limited to 
> one per second.

Just to follow up on some out-of-band communication -- this is a good idea, 
but there was some concern about printf() under mutexes.  I'm not actually 
that concerned about that case (we do it quite a lot for warnings and kernel 
debugging), but it might be useful to consider using log() instead, so that it 
ends up in the system log as well as on the console.

For I while I've wondered if we need a spp to complement pps -- that is, 
limiting printf()s to every (n) seconds, rather than (n) per second.  For 
tunable warnings like this, it would be nice to limit them to once a minute or 
similar.

Finally, we should make sure that in all instances where we point at 
tuning(7), it has something useful to say about the topic :-).

Robert



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1211291027430.59662>