All of lore.kernel.org
 help / color / mirror / Atom feed
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: akpm@osdl.org, lhms-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, Cliff Wickman <cpw@sgi.com>
Subject: Re: [Lhms-devel] [PATCH 4/7] Direct Migration V5: migrate_pages() extension
Date: Wed, 30 Nov 2005 17:34:47 +0900	[thread overview]
Message-ID: <438D6427.8060003@jp.fujitsu.com> (raw)
In-Reply-To: <20051128204304.10037.81195.sendpatchset@schroedinger.engr.sgi.com>

Hi,

Christoph Lameter wrote:
> +int migrate_page_remove_references(struct page *newpage, struct page *page, int nr_refs)
> +{
> +	write_lock_irq(&mapping->tree_lock);
> +
> +	radix_pointer = (struct page **)radix_tree_lookup_slot(
> +						&mapping->page_tree,
> +						page_index(page));
> +
> +	if (!page->mapping ||
> +	    page_count(page) != nr_refs ||
> +	    *radix_pointer != page) {
> +		write_unlock_irq(&mapping->tree_lock);
> +		return 1;
> +	}

I'm testing memory hot removing patch based on your patch.

I found a problem around the shmem,
but I'm not sure whether it can be problem on migration or not.

Problem is:
1. a page of shmem(tmpfs)'s generic file is in page-cache. assume page is diry.
2. When it passed to migrate_page(), it reaches pageout() in the middle of migrate_page().
3. pageout calls shmem_writepage(), and the page turns to be swap-cache page.
    At this point, page->mapping becomes NULL (see move_to_swapcache())
4. pageout retunrs PAGE_SUCCESS.
5. Finaly, migrate_page() goes to redo.
6. retry
7. Because spwapper_space's  a_ops->migratepage is not NULL,
    "Avoid write back hook" in patch 7/7 is used.
+		if (mapping->a_ops->migratepage) {
+			rc = mapping->a_ops->migratepage(newpage, page);
+			goto unlock_both;
+                }
    a_ops->migrate_page points to migrate_page() in mm/vmscan.c
8. migrate_page() try to replace radix tree entry in swapper_space.
9. Becasue page->mapping is NULL(becasue of 3), migrate_page_remove_references() fails.

I avoid above situation by following code in migrate_page_remove_references() now.
But I'm not sure whether this is sane fix or not.
 > +	if ((!PageSwapCache(page) && !page->mapping) ||
 > +	    page_count(page) != nr_refs ||
 > +	    *radix_pointer != page) {
 > +		write_unlock_irq(&mapping->tree_lock);
 > +		return 1;
 > +	}



-- Kame


  reply	other threads:[~2005-11-30  8:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-28 20:42 [PATCH 0/7] Direct Migration V5: Overview Christoph Lameter
2005-11-28 20:42 ` [PATCH 1/7] Swap Migration: Fix double unlock Christoph Lameter
2005-11-28 20:42 ` [PATCH 2/7] Swap Migration: Consolidate successful migration handling Christoph Lameter
2005-11-28 20:42 ` [PATCH 3/7] Direct Migration V5: PageSwapCache checks Christoph Lameter
2005-11-28 20:43 ` [PATCH 4/7] Direct Migration V5: migrate_pages() extension Christoph Lameter
2005-11-30  8:34   ` KAMEZAWA Hiroyuki [this message]
2005-11-30 16:41     ` [Lhms-devel] " Christoph Lameter
2005-11-30 17:28       ` Kamezawa Hiroyuki
2005-11-30 17:55         ` Christoph Lameter
2005-11-30 23:48           ` KAMEZAWA Hiroyuki
2005-11-28 20:43 ` [PATCH 5/7] Direct Migration V5: remove_from_swap() to remove swap ptes Christoph Lameter
2005-11-30 11:29   ` [Lhms-devel] " KAMEZAWA Hiroyuki
2005-11-30 16:31     ` Christoph Lameter
2005-11-28 20:43 ` [PATCH 6/7] Direct Migration V5: upgrade MPOL_MF_MOVE and sys_migrate_pages() Christoph Lameter
2005-11-28 20:43 ` [PATCH 7/7] Direct Migration V5: Avoid writeback / page_migrate() method Christoph Lameter

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=438D6427.8060003@jp.fujitsu.com \
    --to=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=akpm@osdl.org \
    --cc=clameter@sgi.com \
    --cc=cpw@sgi.com \
    --cc=lhms-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /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.