+ mm-migration-add-destination-page-freeing-callback.patch added to -mm tree
Subsystems (6)
[email protected]
maintainerSubject: + mm-migration-add-destination-page-freeing-callback.patch added to -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Wed, 07 May 2014 14:20:45 -0700
The patch titled
Subject: mm, migration: add destination page freeing callback
has been added to the -mm tree. Its filename is
mm-migration-add-destination-page-freeing-callback.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-migration-add-destination-page-freeing-callback.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-migration-add-destination-page-freeing-callback.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: David Rientjes <[email protected]>
Subject: mm, migration: add destination page freeing callback
Memory migration uses a callback defined by the caller to determine how to allocate destination pages. When migration fails for a source page, however, it frees the destination page back to the system.
This patch adds a memory migration callback defined by the caller to determine how to free destination pages. If a caller, such as memory compaction, builds its own freelist for migration targets, this can reuse already freed memory instead of scanning additional memory.
If the caller provides a function to handle freeing of destination pages, it is called when page migration fails. If the caller passes NULL then freeing back to the system will be handled as usual. This patch introduces no functional change.
---
include/linux/migrate.h | 11 ++++--- mm/compaction.c | 2 - mm/memory-failure.c | 4 +- mm/memory_hotplug.c | 2 - mm/mempolicy.c | 4 +- mm/migrate.c | 55 ++++++++++++++++++++++++++------------ mm/page_alloc.c | 2 - 7 files changed, 53 insertions(+), 27 deletions(-)
include/linux/migrate.h renamed from include/linux/migrate.h~mm-migration-add-destination-page-freeing-callback +7 -4
@@ -5,7 +5,9 @@#include <linux/mempolicy.h> #include <linux/migrate_mode.h> -typedef struct page *new_page_t (struct page *,unsigned long private,int **); +typedef struct page *new_page_t (struct page *page,unsigned long private, +int **reason); +typedef void free_page_t (struct page *page,unsigned long private);/* * Return values from addresss_space_operations.migratepage():
@@ -38,7 +40,7 @@ enum migrate_reason {extern void putback_movable_pages (struct list_head *l);extern int migrate_page (struct address_space *,struct page *,struct page *,enum migrate_mode ); -extern int migrate_pages (struct list_head *l,new_page_t x, +extern int migrate_pages (struct list_head *l,new_page_t new,free_page_t free,unsigned long private,enum migrate_mode mode,int reason);extern int migrate_prep (void );
@@ -56,8 +58,9 @@ extern int migrate_page_move_mapping(str#else static inline void putback_movable_pages (struct list_head *l) {} -static inline int migrate_pages (struct list_head *l,new_page_t x, -unsigned long private,enum migrate_mode mode,int reason) +static inline int migrate_pages (struct list_head *l,new_page_t new, +free_page_t free,unsigned long private,enum migrate_mode mode, +int reason) {return -ENOSYS ; }static inline int migrate_prep (void ) {return -ENOSYS ; }
mm/compaction.c renamed from mm/compaction.c~mm-migration-add-destination-page-freeing-callback +1 -1
@@ -1013,7 +1013,7 @@ static int compact_zone(struct zone *zon } nr_migrate = cc->nr_migratepages; - err =migrate_pages (&cc->migratepages, compaction_alloc, + err =migrate_pages (&cc->migratepages, compaction_alloc,NULL , (unsigned long )cc, cc->sync ?MIGRATE_SYNC_LIGHT :MIGRATE_ASYNC ,MR_COMPACTION );
mm/memory-failure.c renamed from mm/memory-failure.c~mm-migration-add-destination-page-freeing-callback +2 -2
@@ -1500,7 +1500,7 @@ static int soft_offline_huge_page(struct/* Keep page count to indicate a given hugepage is isolated. */ list_move (&hpage->lru, &pagelist); - ret =migrate_pages (&pagelist, new_page,MPOL_MF_MOVE_ALL , + ret =migrate_pages (&pagelist, new_page,NULL ,MPOL_MF_MOVE_ALL ,MIGRATE_SYNC ,MR_MEMORY_FAILURE );if (ret) { pr_info("soft offline: %#lx: migration failed %d, type %lx\n",
@@ -1581,7 +1581,7 @@ static int __soft_offline_page(struct painc_zone_page_state (page,NR_ISOLATED_ANON +page_is_file_cache (page));list_add (&page->lru, &pagelist); - ret =migrate_pages (&pagelist, new_page,MPOL_MF_MOVE_ALL , + ret =migrate_pages (&pagelist, new_page,NULL ,MPOL_MF_MOVE_ALL ,MIGRATE_SYNC ,MR_MEMORY_FAILURE );if (ret) {if (!list_empty (&pagelist)) {
mm/memory_hotplug.c renamed from mm/memory_hotplug.c~mm-migration-add-destination-page-freeing-callback +1 -1
@@ -1394,7 +1394,7 @@ do_migrate_range(unsigned long start_pfn* alloc_migrate_target should be improooooved!! * migrate_pages returns # of failed pages. */ - ret =migrate_pages (&source, alloc_migrate_target,0 , + ret =migrate_pages (&source, alloc_migrate_target,NULL ,0 ,MIGRATE_SYNC ,MR_MEMORY_HOTPLUG );if (ret)putback_movable_pages (&source);
mm/mempolicy.c renamed from mm/mempolicy.c~mm-migration-add-destination-page-freeing-callback +2 -2
@@ -978,7 +978,7 @@ static int migrate_to_node(struct mm_str flags | MPOL_MF_DISCONTIG_OK, &pagelist);if (!list_empty (&pagelist)) { - err =migrate_pages (&pagelist, new_node_page, dest, + err =migrate_pages (&pagelist, new_node_page,NULL , dest,MIGRATE_SYNC ,MR_SYSCALL );if (err)putback_movable_pages (&pagelist);
@@ -1227,7 +1227,7 @@ static long do_mbind(unsigned long startif (!list_empty (&pagelist)) {WARN_ON_ONCE (flags &MPOL_MF_LAZY ); nr_failed =migrate_pages (&pagelist, new_vma_page, - (unsigned long )vma, +NULL , (unsigned long )vma,MIGRATE_SYNC ,MR_MEMPOLICY_MBIND );if (nr_failed)putback_movable_pages (&pagelist);
mm/migrate.c renamed from mm/migrate.c~mm-migration-add-destination-page-freeing-callback +39 -16
123 lines not on this page · raw message
mm/page_alloc.c renamed from mm/page_alloc.c~mm-migration-add-destination-page-freeing-callback +1 -1
@@ -6221,7 +6221,7 @@ static int __alloc_contig_migrate_range( cc->nr_migratepages -= nr_reclaimed; ret =migrate_pages (&cc->migratepages, alloc_migrate_target, -0 ,MIGRATE_SYNC ,MR_CMA ); +NULL ,0 ,MIGRATE_SYNC ,MR_CMA ); }if (ret <0 ) {putback_movable_pages (&cc->migratepages);
_
Patches currently in -mm which might be from [email protected] are
mm-memcontrol-remove-hierarchy-restrictions-for-swappiness-and-oom_control.patch mm-memcontrol-remove-hierarchy-restrictions-for-swappiness-and-oom_control-fix.patch hugetlb-prep_compound_gigantic_page-drop-__init-marker.patch hugetlb-add-hstate_is_gigantic.patch hugetlb-update_and_free_page-dont-clear-pg_reserved-bit.patch hugetlb-move-helpers-up-in-the-file.patch hugetlb-add-support-for-gigantic-page-allocation-at-runtime.patch mem-hotplug-implement-get-put_online_mems.patch slab-get_online_mems-for-kmem_cache_createdestroyshrink.patch mm-debug-make-bad_range-output-more-usable-and-readable.patch memcg-do-not-hang-on-oom-when-killed-by-userspace-oom-access-to-memory-reserves.patch mm-migration-add-destination-page-freeing-callback.patch mm-compaction-return-failed-migration-target-pages-back-to-freelist.patch mm-compaction-add-per-zone-migration-pfn-cache-for-async-compaction.patch mm-compaction-embed-migration-mode-in-compact_control.patch mm-thp-avoid-excessive-compaction-latency-during-fault.patch mm-compaction-terminate-async-compaction-when-rescheduling.patch mm-utilc-add-kstrimdup.patch
linux-next.patch