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

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

--RhUH2Ysw6aD5utA4
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Nov 29, 2012 at 10:30:07AM +0000, Robert Watson wrote:
>=20
> On Thu, 29 Nov 2012, Pawel Jakub Dawidek wrote:
>=20
> > 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 b=
e=20
> > 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=
=20
> > console that kern.maxfiles limit is reached, but when I hit=20
> > kern.ipc.maxsockets limit and started to get ENOBUFS errors it took me =
a=20
> > while to figure out what to tune.
> >
> > This patch allows to configure advice for the use and give him some det=
ails=20
> > in a very easy way. The warning printed on the console is rate-limited =
to=20
> > one per second.
>=20
> Just to follow up on some out-of-band communication -- this is a good ide=
a,=20
> but there was some concern about printf() under mutexes.  I'm not actuall=
y=20
> that concerned about that case (we do it quite a lot for warnings and ker=
nel=20
> debugging), but it might be useful to consider using log() instead, so th=
at it=20
> ends up in the system log as well as on the console.

I'm happy with using log(9), but currently when log(9) is used, the
message is not printed on the console, it only ends up in the system
log. printf(9) on the other hand is printed on the console and is
appended to the system logs.

The only case where log(9) will actually log to the console, AFAIR, is
when syslogd is not working.

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

Or change pps to ppm. I agree that getting these warning every second is
too aggressive.

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

Yes, I am aware the warnings proposed in the patch are a bit too
optimistic:)

--=20
Pawel Jakub Dawidek                       http://www.wheelsystems.com
FreeBSD committer                         http://www.FreeBSD.org
Am I Evil? Yes, I Am!                     http://tupytaj.pl

--RhUH2Ysw6aD5utA4
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iEYEARECAAYFAlC3OwAACgkQForvXbEpPzQfigCfWcBL+1DTzY0w9Co2AWNZnjDs
LNkAoK53E5T30vGbsIRdJhC7lV3tQcZ9
=N8rI
-----END PGP SIGNATURE-----

--RhUH2Ysw6aD5utA4--



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