[PATCH 0/5] Swapless page migration V2: Overview

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Swapless Page migration V2

Currently page migration is depending on the ability to assign swap entries
to pages. However, those entries will only be to identify anonymous pages.
Page migration will not work without swap although swap space is never
really used.

This patchset removes that dependency by introducing a special type of
swap entry that encodes a pfn number of the page being migrated. If that
swap pte (a migration entry) is encountered then do_swap_page() will redo the
fault until the migration entry has been removed.

Migration entries have a very short lifetime and exist only while the page is
locked. Only a few supporting functions are needed.

To some extend this covers the same ground as Marcelo's migration
cache. However, I hope that this approach is simpler and less intrusive.

The migration functions will still be able to use swap entries if a page
is already on the swap cache. But migration functions will no longer assign
swap entries to pages or remove them. Maybe lazy migration can then manage
its own swap cache or migration cache if needed?

Efficiency of migration is increased by:

1. Avoiding useless retries
   The use of migration entries avoids raising the page count in do_swap_page().
   The existing approach can increase the page count between the unmapping
   of the ptes for a page and the page migration page count check resulting
   in having to retry migration although all accesses have been stopped.

2. Swap entries do not have to be assigned and removed from pages.

3. No swap space has to be setup for page migration. Page migration
   will never use swap.

The patchset will allow later patches to enable migration of VM_LOCKED vmas,
the ability to exempt vmas from page migration, and allow the implementation
of a another userland migration API for handling batches of pages.

This patchset was first discussed here:

http://marc.theaimsgroup.com/?l=linux-mm&m=114413402522102&w=2

Changes from V1->V2:
- Make this even lighter on the VM by moving the migration removal
  code into mm/migrate.c
- Do not increase pagecount in do_swap_page()
- Make this work and build correctly for non swap and non migration
  cases.
- Stress testing and work out (hopefully) all kinks.

The patchset consists of five patches:

1. try_to_unmap(): Rename ignrefs to "migration"

   We will be using that try_to_unmap flag in the next patch to
   mean that page migration has called try_to_unmap().

2. Add migration swap entries

   Add the SWP_TYPE_MIGRATION and a few necessary handlers for this
   type of entry. Also modify do_swap_page() to repeat fault if
   a migration entry is encountered.

3. try_to_unmap(): Create migration entries if migration calls
   try_to_unmap for pages without PageSwapCache() but with the
   migration flag set.

4. Rip out old swap migration code

   Remove all the old swap based code. Note that this also removes the fallback
   to swap if all other attempts to migrate fail and also the ability to
   migrate to swap (which was never used)

5. Revise main migration code

   Revise the migration logic to use the new migration entries. Add
   functions to convert migration entries to regular ptes.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux