All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v11 00/14] HMM anomymous memory migration to device memory
@ 2015-10-21 21:10 ` Jérôme Glisse
  0 siblings, 0 replies; 30+ messages in thread
From: Jérôme Glisse @ 2015-10-21 21:10 UTC (permalink / raw)
  To: akpm, linux-kernel, linux-mm
  Cc: Linus Torvalds, joro, Mel Gorman, H. Peter Anvin, Peter Zijlstra,
	Andrea Arcangeli, Johannes Weiner, Larry Woodman, Rik van Riel,
	Dave Airlie, Brendan Conoboy, Joe Donohue, Christophe Harle,
	Duncan Poole, Sherry Cheung, Subhash Gutti, John Hubbard,
	Mark Hairgrove, Lucien Dunning, Cameron Buschardt,
	Arvind Gopalakrishnan, Haggai Eran, Shachar Raindel, Liran Liss,
	Roland Dreier, Ben Sander, Greg Stoner, John Bridgman,
	Michael Mantor, Paul Blinzer, Leonid Shamis, Laurent Morichetti,
	Alexander Deucher

Minor fixes since last post, apply on top of 4.3rc6. Tree with
the patchset:

git://people.freedesktop.org/~glisse/linux hmm-v11 branch

This patchset implement anonymous memory migration for HMM.
See HMM patchset for full description of what is HMM and why
doing HMM :

https://lkml.org/lkml/2015/10/21/739

Seamless migration from system memory to device memory ie on CPU
access we migrate memory back to system memory so CPU can access
it again.

Design is simple, a new special swap type is added and CPU pte are
set to this special swap type for migrated memory. On CPU page fault
HMM use its mirror page table to find proper page into device memory
and migrate it back to system memory.

Migration to device memory involves several steps :
  - First CPU page table is updated to special pte and current
    pte is save to temporary array.
  - We check that all pte are for normal/real pages.
  - We check that no one holds an extra reference on the page.
  - At this point we know we are the only one know about that
    memory and we can safely copy it to device memory.
  - Once everything is copied and fine on device side we free
    the system ram pages.

Migration from device memory back to system memory is simpler:
  - We get exclusive access for each pte we want to migrate back
    (special swap pte value).
  - We allocate system memory (memcg and anon_vma handled here).
  - We copy back device memory content into system memory and
    update device page table to point to system memory.
  - We update CPU page table to point to new system memory.

Cheers,
Jérôme


^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2015-10-21 20:21 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-21 21:10 [PATCH v11 00/14] HMM anomymous memory migration to device memory Jérôme Glisse
2015-10-21 21:10 ` Jérôme Glisse
2015-10-21 21:10 ` [PATCH v11 01/14] fork: pass the dst vma to copy_page_range() and its sub-functions Jérôme Glisse
2015-10-21 21:10   ` Jérôme Glisse
2015-10-21 21:10 ` [PATCH v11 02/14] HMM: add special swap filetype for memory migrated to device v2 Jérôme Glisse
2015-10-21 21:10   ` Jérôme Glisse
2015-10-21 21:10 ` [PATCH v11 03/14] HMM: add new HMM page table flag (valid device memory) Jérôme Glisse
2015-10-21 21:10   ` Jérôme Glisse
2015-10-21 21:10 ` [PATCH v11 04/14] HMM: add new HMM page table flag (select flag) Jérôme Glisse
2015-10-21 21:10   ` Jérôme Glisse
2015-10-21 21:10 ` [PATCH v11 05/14] HMM: handle HMM device page table entry on mirror page table fault and update Jérôme Glisse
2015-10-21 21:10   ` Jérôme Glisse
2015-10-21 21:10 ` [PATCH v11 06/14] HMM: mm add helper to update page table when migrating memory back v2 Jérôme Glisse
2015-10-21 21:10   ` Jérôme Glisse
2015-10-21 21:10 ` [PATCH v11 07/14] HMM: mm add helper to update page table when migrating memory v2 Jérôme Glisse
2015-10-21 21:10   ` Jérôme Glisse
2015-10-21 21:10 ` [PATCH v11 08/14] HMM: new callback for copying memory from and to device " Jérôme Glisse
2015-10-21 21:10   ` Jérôme Glisse
2015-10-21 21:10 ` [PATCH v11 09/14] HMM: allow to get pointer to spinlock protecting a directory Jérôme Glisse
2015-10-21 21:10   ` Jérôme Glisse
2015-10-21 21:10 ` [PATCH v11 10/14] HMM: split DMA mapping function in two Jérôme Glisse
2015-10-21 21:10   ` Jérôme Glisse
2015-10-21 21:10 ` [PATCH v11 11/14] HMM: add helpers for migration back to system memory v3 Jérôme Glisse
2015-10-21 21:10   ` Jérôme Glisse
2015-10-21 21:10 ` [PATCH v11 12/14] HMM: fork copy migrated memory into system memory for child process Jérôme Glisse
2015-10-21 21:10   ` Jérôme Glisse
2015-10-21 21:10 ` [PATCH v11 13/14] HMM: CPU page fault on migrated memory Jérôme Glisse
2015-10-21 21:10   ` Jérôme Glisse
2015-10-21 21:10 ` [PATCH v11 14/14] HMM: add mirror fault support for system to device memory migration v3 Jérôme Glisse
2015-10-21 21:10   ` Jérôme Glisse

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.