9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Russ Cox" <rsc@swtch.com>
To: 9fans@9fans.net
Subject: Re: [9fans] odd out-of-memory behavior
Date: Fri, 25 Jul 2008 14:09:23 -0400	[thread overview]
Message-ID: <20080725180709.0B0441E8C1C@holo.morphisms.net> (raw)
In-Reply-To: <affb36fb79a62b76bfcbcbaea0a78eea@coraid.com>

> 311954: fs killed: out of memory
> out of physical memory; no swap configured
> 311954: fs killed: out of memory
> out of physical memory; no swap configured
> 311954: fs killed: out of memory
>
> there's a sleep of 5 seconds after killbig
> is called.  so, though it's hard to imagine,
> it must be taking 100s to clean up this process.

/sys/src/9/port/proc.c:/^killbig marks the process
to be killed, but if it can't acquire the lock on that
process's segments, the memory is not actually
freed immediately:

	kp->procctl = Proc_exitbig;
	for(i = 0; i < NSEG; i++) {
		s = kp->seg[i];
		if(s != 0 && canqlock(&s->lk)) {
			mfreeseg(s, s->base, (s->top - s->base)/BY2PG);
			qunlock(&s->lk);
		}
	}

Perhaps another upas/fs proc sharing the same
segment is holding the segment lock and
blocking on something else.

If you can make it happen again, you could try
to run

	acid -k -l kernel 1 /386/9pccpu  # or your kernel image
	stacks()

though of course without any memory it's going to
be hard to start acid.  You might be able to pull it off
if you cpu somewhere else, bind /mnt/term/proc /proc,
and then start acid there before you run the machine
out of memory.  As long as the exportfs serving /mnt/term
doesn't need any new memory pages, it should be able
to serve /proc well enough to the remote acid.

Russ



  reply	other threads:[~2008-07-25 18:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-25 16:44 erik quanstrom
2008-07-25 18:09 ` Russ Cox [this message]
2008-07-25 18:25   ` erik quanstrom
2008-07-25 19:39     ` Russ Cox
2008-07-27  1:20   ` erik quanstrom
2008-07-27  2:20     ` Russ Cox
2008-07-27  2:21     ` Russ Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080725180709.0B0441E8C1C@holo.morphisms.net \
    --to=rsc@swtch.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).