All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@zip.com.au>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Rik van Riel <riel@conectiva.com.br>,
	linux-mm@kvack.org, Andrea Arcangeli <andrea@suse.de>,
	Marcelo Tosatti <marcelo@conectiva.com.br>
Subject: Re: strange locking __find_get_swapcache_page()
Date: Tue, 31 Jul 2001 20:19:21 +1000	[thread overview]
Message-ID: <3B668629.34797B3F@zip.com.au> (raw)
In-Reply-To: Pine.LNX.4.33.0107301839440.19638-100000@penguin.transmeta.com

Linus Torvalds wrote:
> 
> On Mon, 30 Jul 2001, Rik van Riel wrote:
> >
> > I've encountered a suspicious piece of code in filemap.c:
> >
> > struct page * __find_get_swapcache_page( ... )
> 
> Hmm. I thin the whole PageSwapCache() test is bogus - if we found it on
> the swapper_space address space, then the page had better be a swap-cache
> page, and testing for it explicitly is silly.
> 
> Also, it appears that the only caller of this is
> find_get_swapcache_page(), which in itself really doesn't even care: it
> just uses the lookup as a boolen on whether to add a new page to the swap
> cache, and does even _that_ completely wrong. There's a big race there,
> see if you can spot it.

read_swap_cache_async()?  All code paths in that area are
under lock_kernel().

> The fix, I suspect, is to pretty much get rid of the code altogether, and
> make it use add_to_page_cache_unique() or whatever it is called that gets
> the duplicate check _right_.

The whole lot needed spring cleaning 1-2 years ago, but I see no
bugs in there.
--
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/

  parent reply	other threads:[~2001-07-31 10:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-30 19:10 strange locking __find_get_swapcache_page() Rik van Riel
2001-07-31  1:44 ` Linus Torvalds
2001-07-31  9:51   ` Rik van Riel
2001-07-31 10:19   ` Andrew Morton [this message]
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=3B668629.34797B3F@zip.com.au \
    --to=akpm@zip.com.au \
    --cc=andrea@suse.de \
    --cc=linux-mm@kvack.org \
    --cc=marcelo@conectiva.com.br \
    --cc=riel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.