Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Feb 2003 03:53:55 -0800
From:      David Schultz <dschultz@uclink.Berkeley.EDU>
To:        The Hermit Hacker <scrappy@hub.org>
Cc:        freebsd-stable@FreeBSD.ORG
Subject:   Re: latest kernel issue ... or increased KVA_FILES ... ?
Message-ID:  <20030214115355.GA424@HAL9000.homeunix.com>
In-Reply-To: <20030214065945.L76487@localhost>
References:  <20030214065945.L76487@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help
Thus spake The Hermit Hacker <scrappy@hub.org>:
>    I added 'options KVA_FILES=512' to my kernel config last night, and
> rebooted with the new settings, and fear I may have either error'd with
> it, or just am getting hit by a bug in the latest code ...
> 
>   First "stupid question", if I increase KVA_FILES, does that cause any
> changes to 'world' that requires me to do an installworld right away for
> thigns to work?  I upgraded the source from Feb 1st -> Feb 13th, so I only
> did an installkernel, rebooted, and was going to do the installworld
> after, except that after reboot, two daemons that use threads wouldn't
> run, giving errors to /var/log/messages of:
> 
> Feb 13 23:55:35 venus /kernel: pid 901 (nsd8x), uid 65534: exited on signal 6

I assume you mean KVA_PAGES.  Changing that value changes how the
4 GB virtual address space is split between the kernel and
userland applications.  The kernel occupies the upper end of the
space, and the user application's stack (which grows downwards on
most architectures) resides just below that.  If you set aside
more of the virtual address space for the kernel, the start of the
stack is lower and applications have a smaller space.

Pthreads in 4-STABLE uses the start of the main stack as a basis
for determining where to put stacks for individual threads that
are spawned.  The value of KVA_PAGES used to be statically
compiled into pthreads, so you would have to recompile libc every
time you changed KVA_PAGES.  Peter Wemm tried to fix this some
time ago by reading the value from sysctl instead, but his fix is
incomplete.  The patch in the following PR has been verified (not
by me) to fix the problem.  Hopefully it has not been subject to
bit rot over the last few months.

	http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/46341

FYI, the code to deal with thread stacks is completely different
in 5-CURRENT, so the problem is specific to 4.X.

>   Similar was happening to the mysqld daemon ...

Random naive question: Postgresql spawns separate processes
instead of using threads, doesn't it?  How has that worked out,
and is it expected to change?

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




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