linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
To: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: linux-mm@kvack.org, iwamoto@valinux.co.jp, haveblue@us.ibm.com,
	hugh@veritas.com
Subject: Re: migration cache, updated
Date: Tue, 26 Oct 2004 07:25:35 -0200	[thread overview]
Message-ID: <20041026092535.GE24462@logos.cnet> (raw)
In-Reply-To: <20041026.181504.38310112.taka@valinux.co.jp>

On Tue, Oct 26, 2004 at 06:15:04PM +0900, Hirokazu Takahashi wrote:
> Hi, Marcelo,
> 
> > Hi,
> > 
> > This is an improved version of the migration cache patch - 
> > thanks to everyone who contributed - Hirokazu, Iwamoto, Dave,
> > Hugh.
> 
> Some comments.
> 
> > diff -Nur --show-c-function linux-2.6.9-rc2-mm4.mhp.orig/mm/memory.c linux-2.6.9-rc2-mm4.build/mm/memory.c
> > --- linux-2.6.9-rc2-mm4.mhp.orig/mm/memory.c	2004-10-05 15:08:23.000000000 -0300
> > +++ linux-2.6.9-rc2-mm4.build/mm/memory.c	2004-10-25 19:35:18.000000000 -0200
> > @@ -1408,6 +1412,9 @@ static int do_swap_page(struct mm_struct
> >  	pte_unmap(page_table);
> >  	spin_unlock(&mm->page_table_lock);
> >  again:
> > +	if (pte_is_migration(orig_pte)) {
> > +		page = lookup_migration_cache(entry.val);
> > +	} else {
> >  	page = lookup_swap_cache(entry);
> >  	if (!page) {
> >   		swapin_readahead(entry, address, vma);
> > @@ -1433,15 +1440,22 @@ again:
> >  		inc_page_state(pgmajfault);
> >  		grab_swap_token();
> >  	}
> > -
> >  	mark_page_accessed(page);
> >  	lock_page(page);
> >  	if (!PageSwapCache(page)) {
> > +		/* hiro: add !PageMigration(page) here */
> >  		/* page-migration has occured */
> 
> Now, !PageSwapCache(page) means the page isn't neither in the swap-cache
> nor in the migration-cache. The original code is enough.

OK!

> >  		unlock_page(page);
> >  		page_cache_release(page);
> >  		goto again;
> >  	}
> > +	}
> > +
> > +
> > +	if (pte_is_migration(orig_pte)) {
> > +		mark_page_accessed(page);
> > +		lock_page(page);
> > +	}
> >  
> >  	/*
> >  	 * Back out if somebody else faulted in this pte while we
> 
> > diff -Nur --show-c-function linux-2.6.9-rc2-mm4.mhp.orig/mm/vmscan.c linux-2.6.9-rc2-mm4.build/mm/vmscan.c
> > --- linux-2.6.9-rc2-mm4.mhp.orig/mm/vmscan.c	2004-10-05 15:08:23.000000000 -0300
> > +++ linux-2.6.9-rc2-mm4.build/mm/vmscan.c	2004-10-25 19:15:56.000000000 -0200
> > @@ -38,8 +38,6 @@
> >  #include <asm/tlbflush.h>
> >  #include <asm/div64.h>
> >  
> > -#include <linux/swapops.h>
> > -
> >  /*
> >   * The list of shrinker callbacks used by to apply pressure to
> >   * ageable caches.
> > @@ -459,7 +457,9 @@ int shrink_list(struct list_head *page_l
> >  		}
> >  
> >  #ifdef CONFIG_SWAP
> > -		if (PageSwapCache(page)) {
> > +		// FIXME: allow relocation of migrate cache pages 
> > +		// into real swap pages for swapout.
> 
> 
> In my thought, it would be better to remove a target page from the
> LRU lists prior to migration. So that it makes the swap code not to
> grab the page, which is in the migration cache.

I dont see a problem with having the pages on LRU - the reclaiming 
code sees it, but its unfreeable, so it doesnt touch it. 

The reclaiming path should see its a migration page, unmap the pte's
to it, remap them to swapcache pages (and ptes), so they can be
swapped out on pressure.

Can you please expand your thoughts?

> > +		if (PageSwapCache(page) && !PageMigration(page)) {
> >  			swp_entry_t swap = { .val = page->private };
> >  			__delete_from_swap_cache(page);
> >  			write_unlock_irq(&mapping->tree_lock);
> > 
--
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/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

  reply	other threads:[~2004-10-26  9:25 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-25 21:39 Marcelo Tosatti
2004-10-26  1:17 ` Hiroyuki KAMEZAWA
2004-10-26 12:01   ` Marcelo Tosatti
2004-10-26 23:47     ` Hiroyuki KAMEZAWA
2004-10-26  6:37 ` Hirokazu Takahashi
2004-10-26  9:20   ` Marcelo Tosatti
2004-10-26 13:45     ` Hirokazu Takahashi
2004-10-26 11:41       ` Marcelo Tosatti
2004-10-27 13:40       ` Hirokazu Takahashi
2004-10-26  9:15 ` Hirokazu Takahashi
2004-10-26  9:25   ` Marcelo Tosatti [this message]
2004-10-26 14:01     ` Hirokazu Takahashi
2004-10-26 12:24       ` Marcelo Tosatti
2004-10-27  7:25         ` IWAMOTO Toshihiro
2004-10-27 16:27           ` Marcelo Tosatti
2004-10-27 13:48         ` Hirokazu Takahashi
2004-10-28 15:19           ` Marcelo Tosatti
2004-10-28 16:05             ` Marcelo Tosatti
2004-10-28 18:51               ` Dave Hansen
2004-10-28 16:26                 ` Marcelo Tosatti
2004-10-28 20:24                   ` Dave Hansen
2004-11-03 15:21                   ` Marcelo Tosatti
2004-11-04  8:01                     ` Hirokazu Takahashi
2004-11-05 13:49               ` Hirokazu Takahashi
2004-11-05 15:16                 ` Marcelo Tosatti
2004-11-16  4:07                   ` Hirokazu Takahashi
2004-11-23 12:14                     ` Marcelo Tosatti
2004-11-24 10:21                       ` Hirokazu Takahashi
2004-12-01 20:21                         ` Marcelo Tosatti
2004-12-08 13:23                           ` Hirokazu Takahashi
2005-01-17  9:59                             ` Marcelo Tosatti
2005-01-31 18:33                               ` Ray Bryant
2005-01-31 18:44                                 ` Marcelo Tosatti
2005-02-02 21:28                                   ` Ray Bryant
2005-02-03  2:59                                     ` Hirokazu Takahashi
2005-02-03 15:19                                       ` Ray Bryant
2005-02-04  7:32                                         ` Hirokazu Takahashi
2005-02-04 16:08                                           ` Ray Bryant
2005-02-07 12:46                                             ` Hirokazu Takahashi
2005-02-07 20:54                                               ` Ray Bryant
2005-02-08  2:17                                                 ` Hirokazu Takahashi
     [not found]                                                   ` <42083913.9050306@sgi.com>
     [not found]                                                     ` <20050209.151938.63052333.taka@valinux.co.jp>
2005-02-09 20:48                                                       ` Ray Bryant
2005-02-07 13:16                                     ` Hirokazu Takahashi
2005-02-03  2:49                               ` Hirokazu Takahashi
2005-01-03 19:04 page migration Ray Bryant
2005-01-03 19:37 ` Dave Hansen
2005-01-03 20:15   ` Ray Bryant
2005-01-04 14:42     ` Hirokazu Takahashi
2005-01-04 17:30       ` Ray Bryant
2005-01-04 17:40         ` process " Dave Hansen
2005-01-04 18:26           ` Ray Bryant
2005-01-07 16:57             ` migration cache, updated Ray Bryant
2005-01-10 10:07               ` Marcelo Tosatti
2005-01-03 19:25 Ray Bryant
2005-02-06  2:02 Marcelo Tosatti

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=20041026092535.GE24462@logos.cnet \
    --to=marcelo.tosatti@cyclades.com \
    --cc=haveblue@us.ibm.com \
    --cc=hugh@veritas.com \
    --cc=iwamoto@valinux.co.jp \
    --cc=linux-mm@kvack.org \
    --cc=taka@valinux.co.jp \
    /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