9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: cinap_lenrek@gmx.de
To: 9fans@9fans.net
Subject: [9fans] duppage
Date: Sat, 25 Feb 2012 04:29:33 +0100	[thread overview]
Message-ID: <a86d5c404cb6cfea4e83121474e84ded@gmx.de> (raw)

discovered odd behaviour on a mp system.  it was running rchttpd and
werc and after like 3 or 7 days of load, broken sed and grep processes
appeared in the process table.  inspecting the process with acid
yields a strange picture.  the process crashed (or aborted themselves)
before any data was read from stdin just after allocating some memory
(grep uses sbrk() directly, where sed uses pool malloc).  in the case
of grep, the global bloc seemed to have been reset to a past value,
and seds mainmem structure was also inconsistent with reality.

while trying to put the pieces together, something interesting came up.

duppage() is called by fixfault for COW, with a locked, image backed,
non shared page.  it makes a new copy for the image cache, and then
removes the page from the image cache.

to do this, it has to allocate a new page from the page allocator,
temporarily unlocking the page.  what we observe is that when duppage
reacquires the page lock, the pages refcount sometimes is >1 meaning
another processor just grabed that page out of the image cache.
(tested this with a print() and it triggered multiple times right after boot)

fixfault still assumes the page to be non shared and inserts it into
the process pagetable.

a change that rechecks the refcount after calling duppage() in
fixfault() and doing a copy like for the ref > 1 case seems to have
made the problem go away. (system is running for 8 days now)

anyone with a mp system can confirm this?

--
cinap




             reply	other threads:[~2012-02-25  3:29 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-25  3:29 cinap_lenrek [this message]
2012-02-25 20:09 ` Charles Forsyth
2012-02-26  4:13 ` erik quanstrom
2012-02-29 10:31 ` Richard Miller
2012-02-29 14:14   ` cinap_lenrek
2012-02-29 19:35     ` Richard Miller
2012-02-29 19:50       ` cinap_lenrek
2012-03-03  9:58         ` Richard Miller
2012-03-03 19:30           ` cinap_lenrek
2012-03-13 23:55 erik quanstrom
2014-06-08 14:53 erik quanstrom
2014-06-08 17:15 ` cinap_lenrek
2014-06-08 17:22 ` Charles Forsyth
2014-06-08 17:34   ` erik quanstrom
2014-06-08 17:50     ` Charles Forsyth
2014-06-08 17:53       ` erik quanstrom
2014-06-08 17:54       ` cinap_lenrek
2014-06-08 18:15         ` erik quanstrom
2014-06-08 18:37           ` Charles Forsyth
2014-06-09  8:23             ` Charles Forsyth
2014-06-09 13:21               ` erik quanstrom
2014-06-10  1:35               ` erik quanstrom
2014-06-10  3:53                 ` cinap_lenrek
2014-06-10 12:58                   ` erik quanstrom
2014-06-10 13:56                     ` Steve Simon
2014-06-10 15:30                       ` erik quanstrom
2014-06-10 14:06                     ` cinap_lenrek
2014-06-11 18:04           ` erik quanstrom
2014-06-08 17:49   ` cinap_lenrek

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=a86d5c404cb6cfea4e83121474e84ded@gmx.de \
    --to=cinap_lenrek@gmx.de \
    --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).