9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: cinap_lenrek@felloff.net
To: 9fans@9fans.net
Subject: Re: [9fans] imagereclaim()
Date: Sun,  2 Mar 2014 02:21:08 +0100	[thread overview]
Message-ID: <2cf9720b82e19cf7af8332c8ebddeb76@felloff.net> (raw)
In-Reply-To: <CAOw7k5gsC5JVQnq286yOyYpJzDvqGV9mBwq9au0-Wm1P3DLXqA@mail.gmail.com>

i checked the code on sources again and found the issue.
the lookpage() in 9front is different. we lock the page from
the image cache hash chain and check if the page is still
cached and for the right disk address under the lock.

but if it changed or got uncached by duppage(), we unlock
and *retry* instead of giving up the search.

so duppage() appears atomic on 9front, but on labs, a process
already commited to use that page in lookpage() will get a
uncached page after the lock() succeeds and miss the (potential)
new page put in by duppage().

but what you describe is possible with pio() in general.

a process decides to demand load a page in pio() when lookpage()
doesnt return a cached page.

if multiple processes compete on loading the same page while its not in
the cache, they will indeed do so. in the case that they share the
segment, it will get deduplicated after the load and the page of the
first process finishing the load wins, the other pages will be put back
on the freelist (uncached). if they use distinct segments,
they (the processes) will all cache ther pages in the image and the
image will end up with multiple pages caching the same disk address
of the file.

it would be nice if the SP9SSS could speak out in detail on how they
do page caching differently than classic plan9.

--
cinap



  reply	other threads:[~2014-03-02  1:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-01 21:46 cinap_lenrek
2014-03-01 21:55 ` erik quanstrom
2014-03-01 22:22   ` cinap_lenrek
2014-03-01 22:52     ` erik quanstrom
2014-03-01 23:05       ` cinap_lenrek
2014-03-01 23:11         ` erik quanstrom
2014-03-01 23:14         ` Charles Forsyth
2014-03-02  1:21           ` cinap_lenrek [this message]
2014-03-02  3:14             ` erik quanstrom
2014-03-02  3:55               ` cinap_lenrek
2014-03-02  4:05                 ` erik quanstrom
2014-03-02  4:30                   ` cinap_lenrek
2014-03-02  9:48                 ` Charles Forsyth
2014-03-02 18:46                   ` cinap_lenrek
2014-03-02 18:53                     ` Charles Forsyth
2014-03-02 22:59                       ` Anthony Martin
2014-03-03  1:00                         ` erik quanstrom
2014-03-01 23:09     ` Charles Forsyth

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=2cf9720b82e19cf7af8332c8ebddeb76@felloff.net \
    --to=cinap_lenrek@felloff.net \
    --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).