Subject: README: kernel pty struct allocation change
To: None <email@example.com>
From: Jaromír Doleček <firstname.lastname@example.org>
Date: 09/09/2000 23:53:17
in order to make the number of available ptys run-time configuration
value rather than kernel compile one, the way pty structs are
allocated changed on -current (this does not influence 1.5 branch).
The value previously set in kernel config via
pseudo-device pty foo
now does not mean that the fixed number is available, but rather
how big is the array of pointers to pty structs on the start.
If 'foo' is not given, 64 is used. This initial array is enlarged
There is now new sysctl kern.maxptys, which limits how many maximum
pty's might exist. This defaults to 512. This limit can only be
raised. Note you need to install newer kernel includes and rebuild
sysctl(8) for it to support this new sysctl.
Individual pty structs are allocated on demand. This may save
some tiny bits of memory when only couple of pty's would be used.
The allocated memory is never freed - once it's used for pty,
it's never released back. Primarily, this is to avoid excessive
memory (de)allocations - the idea beeing that number of used pty's
is normally fairly stabilized, so it's not worth the efford
to try free unsed memory, since it would be allocated again very soon.
Please let me know if you encounter any problems related to this
The relevant revisions are
$NetBSD: kern_sysctl.c,v 1.77 2000/09/09 16:42:04 jdolecek Exp $
$NetBSD: tty_pty.c,v 1.47 2000/09/09 16:42:04 jdolecek Exp $
$NetBSD: sysctl.h,v 1.56 2000/09/09 16:42:06 jdolecek Exp $
Jaromir Dolecek <jdolecek@NetBSD.org> http://www.ics.muni.cz/~dolecek/
@@@@ Wanna a real operating system ? Go and get NetBSD, damn! @@@@