9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] duppage
@ 2012-03-13 23:55 erik quanstrom
  0 siblings, 0 replies; 29+ messages in thread
From: erik quanstrom @ 2012-03-13 23:55 UTC (permalink / raw)
  To: 9fans

with panic's duppage fix, i get hits.

Tue Mar 13 17:31:34: minooka# duppage: p->ref 2 != 1
Tue Mar 13 17:31:34: duppage: p->ref 2 != 1
Tue Mar 13 17:31:34: duppage: p->ref 3 != 1
Tue Mar 13 17:31:34: duppage: p->ref 2 != 1
Tue Mar 13 17:31:34: duppage: p->ref 2 != 1
Tue Mar 13 17:31:34: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 3 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 3 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 3 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 3 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 3 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:35: duppage: p->ref 2 != 1
Tue Mar 13 17:31:39: duppage: p->ref 2 != 1
Tue Mar 13 17:31:39: duppage: p->ref 2 != 1
Tue Mar 13 17:31:39: duppage: p->ref 2 != 1
Tue Mar 13 17:31:39: duppage: p->ref 2 != 1
Tue Mar 13 17:31:39: duppage: p->ref 2 != 1
Tue Mar 13 17:31:41: duppage: p->ref 2 != 1
Tue Mar 13 17:31:41: duppage: p->ref 2 != 1
Tue Mar 13 17:31:41: duppage: p->ref 2 != 1
Tue Mar 13 17:31:42: duppage: p->ref 2 != 1
Tue Mar 13 17:31:42: duppage: p->ref 2 != 1
Tue Mar 13 17:31:42: duppage: p->ref 2 != 1
Tue Mar 13 17:31:42: duppage: p->ref 2 != 1
Tue Mar 13 17:31:42: duppage: p->ref 2 != 1
Tue Mar 13 17:31:44: duppage: p->ref 2 != 1
Tue Mar 13 17:31:44: duppage: p->ref 2 != 1
Tue Mar 13 17:31:44: duppage: p->ref 2 != 1
Tue Mar 13 17:31:44: duppage: p->ref 2 != 1
Tue Mar 13 17:31:44: duppage: p->ref 2 != 1
Tue Mar 13 17:31:44: duppage: p->ref 2 != 1
Tue Mar 13 17:31:44: duppage: p->ref 2 != 1
Tue Mar 13 17:31:45: duppage: p->ref 2 != 1
Tue Mar 13 17:31:45: duppage: p->ref 2 != 1
Tue Mar 13 17:31:45: duppage: p->ref 2 != 1
Tue Mar 13 17:31:45: duppage: p->ref 2 != 1
Tue Mar 13 17:31:45: duppage: p->ref 3 != 1
Tue Mar 13 17:31:45: duppage: p->ref 2 != 1
Tue Mar 13 17:31:45: duppage: p->ref 2 != 1
Tue Mar 13 17:31:45: duppage: p->ref 2 != 1
Tue Mar 13 17:31:45: duppage: p->ref 2 != 1
Tue Mar 13 17:31:45: duppage: p->ref 2 != 1

- erik



^ permalink raw reply	[flat|nested] 29+ messages in thread
* [9fans] duppage
@ 2014-06-08 14:53 erik quanstrom
  2014-06-08 17:15 ` cinap_lenrek
  2014-06-08 17:22 ` Charles Forsyth
  0 siblings, 2 replies; 29+ messages in thread
From: erik quanstrom @ 2014-06-08 14:53 UTC (permalink / raw)
  To: 9fans

i was experimenting a bit with cinap's version of dropping duppage, and for
the lame build the kernel tests there's quite a bit more i/o

		duppage		no duppage
read		45976291	53366962
rpc		73674		75718

you can see below that both end up reading 6909416 bytes
from 6c for 136 executions.  6c is only 264450 text+data,
so that's 26 unnecessary reads (6c had already been cached).

the original fairs better reading only 1816296, but that's
still way too much.

this needs a better algorithm.

- erik

---
without duppage
Opens    Reads  (bytes)   Writes  (bytes) File
    4       43   301801        0        0 /bin/ape/sh
    3       12    61137        0        0 /bin/ls
  155      476  1642711        0        0 /bin/rc
    5       84   602660        0        0 /bin/awk
    9       79   514294        0        0 /bin/6a
  136     1060  6909416        0        0 /bin/6c
    5       50   329397        0        0 /bin/6l
    8       20    66901        0        0 /bin/echo
    3       11    51238        0        0 /bin/xd
    3       13    72700        0        0 /bin/sed
    4       13    54357        0        0 /bin/cp
    4       33   201057        0        0 /bin/file
    4       21   125962        0        0 /bin/strip
    4       12    51024        0        0 /bin/aux/data2s
    2        9    42686        0        0 /bin/rm

with duppage
Opens    Reads  (bytes)   Writes  (bytes) File
    4       31   216169        0        0 /bin/ape/sh
    3       10    50833        0        0 /bin/ls
  155      190   210423        0        0 /bin/rc
    5       57   398636        0        0 /bin/awk
    9       57   357441        0        0 /bin/6a
  136      370  1816296        0        0 /bin/6c
    5       29   178269        0        0 /bin/6l
    8       13    35485        0        0 /bin/echo
    3       11    59756        0        0 /bin/sed
    3        9    40742        0        0 /bin/xd
    4       10    39909        0        0 /bin/cp
    4       18   100617        0        0 /bin/file
    4       12    60634        0        0 /bin/strip
    4        9    37104        0        0 /bin/aux/data2s
    2        8    38150        0        0 /bin/rm



^ permalink raw reply	[flat|nested] 29+ messages in thread
* [9fans] duppage
@ 2012-02-25  3:29 cinap_lenrek
  2012-02-25 20:09 ` Charles Forsyth
                   ` (2 more replies)
  0 siblings, 3 replies; 29+ messages in thread
From: cinap_lenrek @ 2012-02-25  3:29 UTC (permalink / raw)
  To: 9fans

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




^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2014-06-11 18:04 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-13 23:55 [9fans] duppage erik quanstrom
  -- strict thread matches above, loose matches on Subject: below --
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
2012-02-25  3:29 cinap_lenrek
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

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).