linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Rik van Riel <riel@conectiva.com.br>
To: Marcelo Tosatti <marcelo@conectiva.com.br>
Cc: Linus Torvalds <torvalds@transmeta.com>, linux-mm@kvack.org
Subject: Re: Locking issue on try_to_swap_out()
Date: Wed, 17 Jan 2001 18:13:46 +1100 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.31.0101171812460.30841-100000@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.21.0101141154290.12327-100000@freak.distro.conectiva>

On Sun, 14 Jan 2001, Marcelo Tosatti wrote:

> In theory, there is nothing which guarantees that nobody will
> mess with the page between "UnlockPage" and "deactivate_page"
> (that is pretty hard to happen, I suppose, but anyway)
>
> --- mm/vmscan.c.orig       Sun Jan 14 13:23:55 2001
> +++ mm/vmscan.c    Sun Jan 14 13:24:16 2001
> @@ -72,10 +72,10 @@
>                 swap_duplicate(entry);
>                 set_pte(page_table, swp_entry_to_pte(entry));
>  drop_pte:
> -               UnlockPage(page);
>                 mm->rss--;
>                 if (!page->age)
>                         deactivate_page(page);
> +               UnlockPage(page);
>                 page_cache_release(page);
>                 return;
>         }

Why do you suppose the page_cache_release(page) is BELOW
the deactivate_page(page) call ?

We are still holding a reference on the page when we call
deactivate_page(page), this is what keeps the page from
going away from under us.

regards,

Rik
--
Virtual memory is like a game you can't win;
However, without VM there's truly nothing to lose...

		http://www.surriel.com/
http://www.conectiva.com/	http://distro.conectiva.com.br/

--
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.eu.org/Linux-MM/

      reply	other threads:[~2001-01-17  7:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-14 13:57 Marcelo Tosatti
2001-01-17  7:13 ` Rik van Riel [this message]

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.31.0101171812460.30841-100000@localhost.localdomain \
    --to=riel@conectiva.com.br \
    --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