Swapfile problem in 6? (was: 6.0: during kernel compilation, 'kernel linking' freezes PC)

Peter Jeremy PeterJeremy at optushome.com.au
Mon Nov 14 22:57:52 PST 2005


On Mon, 2005-Nov-14 22:38:59 -0800, Rob wrote:
>--- Kris Kennaway <kris at obsecurity.org> wrote:
>> Since you can compile a kernel without it, add DDB,
>> WITNESS and INVARIANTS support, then trigger the
>> deadlock with the swapfile, break to DDB and
>> examine the state of the machine.  See the chapter
>> on kernel debugging in the developers handbook for
>> more instructions.
>
>Thanks, but for now, I cannot compile a new kernel,
>because the kernel compilation terminates with
>insufficient swap space error.

Unfortunately, we're probably not going to be able to provide much
assistance without knowing more about what is happening when it
deadlocks.  (As Kris requests).  BTW, you should probably make
sure you keep "makeoptions DEBUG=-g" and set dumpdev in rc.conf
(which will make it possible to capture and use a crashdump if
you can trigger one).

> Apparently 32 MB is
>not enough for a new kernel compilation.

Quite probably.

>This is my partitioning:
> /dev/ad0s1a    253678  34446 198938    15%    /
> /dev/ad0s1b     39848   8168  39848    20%    (swap)
> /dev/ad0s1d    253678 152958  80426    66%    /var
> /dev/ad0s1e    253678   6016 227368     3%    /home
> /dev/ad0s1f   1624576 727274 767336    49%    /usr

Since your /home is almost empty, how about (temporarily) moving the
contents into /usr and swapping onto ad0s1e rather than into a
swapfile.  This should at least enable you to build a debug kernel.

>First I used 128 MB swapfile on root partition;
>then tried again with a 128 MB swapfile on /var.
>However, exactly the same deadlock occurs:

Have you pre-allocated the swapfile or is it being allocated as necessary?
If the latter, try "dd if=/dev/zero of=swapfile bs=1m count=128"

-- 
Peter Jeremy


More information about the freebsd-stable mailing list