All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Hugh Dickins <hugh@veritas.com>,
	Marcelo Tosatti <marcelo@conectiva.com.br>,
	linux-kernel@vger.kernel.org
Subject: Re: pre12 VM doubts and patch
Date: Thu, 20 Sep 2001 01:49:05 +0200	[thread overview]
Message-ID: <20010920014905.G720@athlon.random> (raw)
In-Reply-To: <20010919232818.T720@athlon.random> <Pine.LNX.4.33.0109191611550.2507-100000@penguin.transmeta.com> <20010920013153.C720@athlon.random>
In-Reply-To: <20010920013153.C720@athlon.random>; from andrea@suse.de on Thu, Sep 20, 2001 at 01:31:53AM +0200

On Thu, Sep 20, 2001 at 01:31:53AM +0200, Andrea Arcangeli wrote:
> --- 2.4.10pre11aa1/mm/vmscan.c.~1~	Tue Sep 18 21:23:49 2001
> +++ 2.4.10pre11aa1/mm/vmscan.c	Thu Sep 20 01:29:58 2001
> @@ -415,7 +415,10 @@
>  				spin_unlock(&pagemap_lru_lock);
>  
>  				ClearPageDirty(page);
> +
> +				page_cache_get(page);
>  				writepage(page);
> +				page_cache_release(page);
>  
>  				spin_lock(&pagemap_lru_lock);
>  				continue;

then in turn we can backout this bit (patch -R)

diff -urN 2.4.10pre11/mm/page_io.c 2.4.10pre12/mm/page_io.c
--- 2.4.10pre11/mm/page_io.c	Tue May  1 19:35:33 2001
+++ 2.4.10pre12/mm/page_io.c	Thu Sep 20 01:44:20 2001
@@ -78,7 +78,15 @@
  	if (!wait) {
  		SetPageDecrAfter(page);
  		atomic_inc(&nr_async_pages);
- 	}
+ 	} else
+		/*
+		 * Must hold a reference until after wait_on_page()
+		 * returned or it could be freed by the VM after
+		 * I/O is completed and the page is been unlocked.
+		 * The asynchronous path is fine since it never
+		 * references the page after brw_page().
+		 */
+		page_cache_get(page);
 
  	/* block_size == PAGE_SIZE/zones_used */
  	brw_page(rw, page, dev, zones, block_size);
@@ -94,6 +102,7 @@
 	/* This shouldn't happen, but check to be sure. */
 	if (page_count(page) == 0)
 		printk(KERN_ERR "rw_swap_page: page unused while waiting!\n");
+	page_cache_release(page);
 
 	return 1;
 }

Andrea

  reply	other threads:[~2001-09-19 23:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-19 17:57 pre12 VM doubts and patch Hugh Dickins
2001-09-19 19:42 ` Hugh Dickins
2001-09-19 21:28   ` Andrea Arcangeli
2001-09-19 23:16     ` Linus Torvalds
2001-09-19 23:31       ` Andrea Arcangeli
2001-09-19 23:49         ` Andrea Arcangeli [this message]
2001-09-20  1:04         ` Jeff Chua
2001-09-20  1:05           ` Andrea Arcangeli
2001-09-20  1:12             ` Jeff Chua
2001-09-19 23:51     ` Hugh Dickins
2001-09-20  0:01       ` Andrea Arcangeli
2001-09-20  5:12 ` Andrea Arcangeli
2001-09-20  5:58   ` Linus Torvalds
2001-09-20  6:08     ` Andrea Arcangeli
2001-09-20  6:15       ` Linus Torvalds
2001-09-20  6:34         ` Andrea Arcangeli
2001-09-20  6:26       ` Andrea Arcangeli
2001-09-20  6:31         ` Linus Torvalds
2001-09-20  6:38           ` Andrea Arcangeli

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=20010920014905.G720@athlon.random \
    --to=andrea@suse.de \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.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 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.