From: Rik van Riel <riel@conectiva.com.br>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-mm@kvack.org, Andrea Arcangeli <andrea@suse.de>,
Andrew Morton <andrewm@uow.edu.au>,
Marcelo Tosatti <marcelo@conectiva.com.br>
Subject: strange locking __find_get_swapcache_page()
Date: Mon, 30 Jul 2001 16:10:13 -0300 (BRST) [thread overview]
Message-ID: <Pine.LNX.4.33L.0107301542230.5582-100000@duckman.distro.conectiva> (raw)
Hi,
I've encountered a suspicious piece of code in filemap.c:
struct page * __find_get_swapcache_page( ... )
...
/*
* We need the LRU lock to protect against page_launder().
*/
spin_lock(&pagecache_lock);
page = __find_page_nolock(mapping, offset, *hash);
if (page) {
spin_lock(&pagemap_lru_lock);
if (PageSwapCache(page))
page_cache_get(page);
else
page = NULL;
spin_unlock(&pagemap_lru_lock);
}
spin_unlock(&pagecache_lock);
Question is ... WHY do we need the pagemap_lru_lock ?
Page_launder() never removes the page from the swap
cache, that is only done by reclaim_page(), and done
while holding the pagecache_lock.
The other places where pages are removed from the
swap cache (tmpfs and free_page_and_swap_cache)
also hold the pagecache_lock.
Taking the pagemap_lru_lock seems unneeded to me...
regards,
Rik
--
Executive summary of a recent Microsoft press release:
"we are concerned about the GNU General Public License (GPL)"
http://www.surriel.com/
http://www.conectiva.com/ http://distro.conectiva.com/
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/
next reply other threads:[~2001-07-30 19:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-30 19:10 Rik van Riel [this message]
2001-07-31 1:44 ` Linus Torvalds
2001-07-31 9:51 ` Rik van Riel
2001-07-31 10:19 ` Andrew Morton
2001-07-31 17:16 ` Linus Torvalds
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=Pine.LNX.4.33L.0107301542230.5582-100000@duckman.distro.conectiva \
--to=riel@conectiva.com.br \
--cc=andrea@suse.de \
--cc=andrewm@uow.edu.au \
--cc=linux-mm@kvack.org \
--cc=marcelo@conectiva.com.br \
--cc=torvalds@transmeta.com \
/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