linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
Cc: linux-mm@kvack.org, lhms-devel@lists.sourceforge.net,
	Hirokazu Takahashi <taka@valinux.co.jp>,
	Marcelo Tosatti <marcelo.tosatti@cyclades.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Subject: Some ideas on lazy migration with swapless migration
Date: Wed, 5 Apr 2006 11:17:21 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0604051055370.1832@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <1144256328.5203.36.camel@localhost.localdomain>

I think it is possible to do lazy migration without having to resort to a 
migration cache by either

A. Forbidding write to the page. The corresponding invocation to
   to do_wp_page() on a write attempt can then be used to migrate the 
   page. However, this would only work for write attempts.

B. Clear the present bit. The corresponding invocation of do_swap_page 
   may check for the type of pte and do the lazy migration and then set 
   the present bit again.

Hmm... B. would be an even better way to replace SWP_TYPE_MIGRATION and 
not use the swap code at all (which would simply take a lock on the page 
and redo the fault after releasing the lock) but it would require some 
work to get arch support for clearing and setting the present bit. 
However, there are only a few arches supporting NUMA and migration. So it 
should be doable.

Maybe the idea with the present bit can be used to further simplify 
migration:

1. Before migration clear all the present bits which guarantees
   that the faults will stall in do_swap_page() since the page is
   locked. No need to reduce the mapcount since the ptes are still there
   and can be switched back to working condition by do_swap_page().

2. do_swap_page() will lock the page (and therefore stall during 
   migration). After the page lock is obtained we check the present bit if
   it is now set then redo the fault. If not then do lazy migration if 
   needed and set the bit.

3. Migration will move the page and then replace ptes with cleared 
   present bits with ptes pointing to the new page with the present bit 
   enabled. 

Since we do not reduce the mapcount, we can use that mapcount to verify 
that it is still safe to get to the corresponding anonymous vma for 
anonymous pages. Some portions of the vm would have to be fixed up to know 
how to deal with valid ptes that are not present (fork and unmap code).

For file backed pages we would not have to remove the references anymore. 
We can migrate in the same way as the anonymous pages. We just need to 
make sure to first change the mapping. That would be an important feature 
for us because it preserves the page state in a better way. We could also 
preserve the dirty bits and accessed bits in the pte.


--
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:"dont@kvack.org"> email@kvack.org </a>

      parent reply	other threads:[~2006-04-05 18:17 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-04  6:57 [RFC 0/6] Swapless Page Migration V1: Overview Christoph Lameter
2006-04-04  6:57 ` [RFC 1/6] Swapless V1: try_to_unmap() - Rename ignrefs to "migration" Christoph Lameter
2006-04-04  6:57 ` [RFC 2/6] Swapless V1: Add SWP_TYPE_MIGRATION Christoph Lameter
2006-04-04 11:04   ` KAMEZAWA Hiroyuki
2006-04-04  6:57 ` [RFC 3/6] Swapless V1: try_to_unmap() - Create migration entries Christoph Lameter
2006-04-04  6:58 ` [RFC 4/6] Swapless V1: remove migration ptes Christoph Lameter
2006-04-04  6:58 ` [RFC 5/6] Swapless V1: Rip out swap migration code Christoph Lameter
2006-04-04 10:37   ` KAMEZAWA Hiroyuki
2006-04-04 15:06     ` Christoph Lameter
2006-04-05  1:06       ` KAMEZAWA Hiroyuki
2006-04-05  2:45         ` Christoph Lameter
2006-04-05  3:33           ` KAMEZAWA Hiroyuki
2006-04-05  3:47             ` Christoph Lameter
2006-04-05  4:07               ` KAMEZAWA Hiroyuki
2006-04-04  6:58 ` [RFC 6/6] Swapless V1: Revise main migration logic Christoph Lameter
2006-04-04 10:58   ` KAMEZAWA Hiroyuki
2006-04-04 14:24     ` Christoph Lameter
2006-04-05 14:46 ` [Lhms-devel] [RFC 0/6] Swapless Page Migration V1: Overview Lee Schermerhorn
2006-04-05 16:28   ` Christoph Lameter
2006-04-05 16:58     ` Lee Schermerhorn
2006-04-05 17:43       ` Christoph Lameter
2006-04-05 18:52         ` Lee Schermerhorn
2006-04-05 18:17       ` Christoph Lameter [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.64.0604051055370.1832@schroedinger.engr.sgi.com \
    --to=clameter@sgi.com \
    --cc=Lee.Schermerhorn@hp.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=lhms-devel@lists.sourceforge.net \
    --cc=linux-mm@kvack.org \
    --cc=marcelo.tosatti@cyclades.com \
    --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