From: Andrew Morton <akpm@zip.com.au>
To: Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>
Cc: Rik van Riel <riel@conectiva.com.br>,
linux-kernel@vger.kernel.org, Thomas Molina <tmolina@cox.net>
Subject: Re: Race in pagevec code
Date: Wed, 21 Aug 2002 10:41:48 -0700 [thread overview]
Message-ID: <3D63D0DC.271B6130@zip.com.au> (raw)
In-Reply-To: 20020821154535.11432.qmail@thales.mathematik.uni-ulm.de
Christian Ehrhardt wrote:
>
> ...
> Both processors succeeded in bringing the page_count to zero,
> i.e. both processors will add the page to their own
> pages_to_free_list.
This is why __pagevec_release() has the refcount check inside the lock.
If someone else grabbed a ref to the page (also inside the lock) via
the LRU, __pagevec_release doesn't free it.
So the rule could be stated as: the page gets freed when there are
no references to it, presence on the LRU counts as a reference,
serialisation is via pagemap_lru_lock.
> ..
>
> I don't have a fix but I think the only real solution is to
> increment the page count if a page is on a lru list. After all
> this is a reference to the page.
One would think so, but that doesn't really change anything.
I agree the locking and reffing in there is really nasty. It
doesn't help that I put four, repeat four bugs in the 20-line
__page_cache_release(). __pagevec_release() is, I think, OK.
It would be much simpler to grab the lock each time
page_cache_release() is executed, but our performance targets
for 2.5 preclude that.
The page->pte.chain != NULL problems predate the locking changes.
We haven't found that one yet.
next prev parent reply other threads:[~2002-08-21 17:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-21 15:45 Race in pagevec code Christian Ehrhardt
2002-08-21 17:41 ` Andrew Morton [this message]
2002-08-21 20:27 ` Rik van Riel
2002-08-21 22:23 ` Christian Ehrhardt
2002-08-21 22:52 ` Andrew Morton
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=3D63D0DC.271B6130@zip.com.au \
--to=akpm@zip.com.au \
--cc=ehrhardt@mathematik.uni-ulm.de \
--cc=linux-kernel@vger.kernel.org \
--cc=riel@conectiva.com.br \
--cc=tmolina@cox.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