The patch titled Preserve write permissions in migration entries has been removed from the -mm tree. Its filename is preserve-write-permissions-in-migration-entries.patch This patch was probably dropped from -mm because it has now been merged into a subsystem tree or into Linus's tree, or because it was folded into its parent patch in the -mm tree. From: Christoph Lameter <clameter@xxxxxxx> Implement the preservation of the write permissions. The preservation of write permission avoids unnecessary COW operations following page migration. Signed-off-by: Christoph Lameter <clameter@xxxxxxx> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- include/linux/swap.h | 5 +++-- include/linux/swapops.h | 15 +++++++++++---- mm/migrate.c | 5 ++++- mm/rmap.c | 2 +- 4 files changed, 19 insertions(+), 8 deletions(-) diff -puN include/linux/swap.h~preserve-write-permissions-in-migration-entries include/linux/swap.h --- devel/include/linux/swap.h~preserve-write-permissions-in-migration-entries 2006-04-27 02:34:09.000000000 -0700 +++ devel-akpm/include/linux/swap.h 2006-04-27 03:10:43.000000000 -0700 @@ -33,8 +33,9 @@ static inline int current_is_kswapd(void #define MAX_SWAPFILES (1 << MAX_SWAPFILES_SHIFT) #else /* Use last entry for page migration swap entries */ -#define MAX_SWAPFILES ((1 << MAX_SWAPFILES_SHIFT)-1) -#define SWP_TYPE_MIGRATION MAX_SWAPFILES +#define MAX_SWAPFILES ((1 << MAX_SWAPFILES_SHIFT)-2) +#define SWP_MIGRATION_READ MAX_SWAPFILES +#define SWP_MIGRATION_WRITE (MAX_SWAPFILES + 1) #endif /* diff -puN include/linux/swapops.h~preserve-write-permissions-in-migration-entries include/linux/swapops.h --- devel/include/linux/swapops.h~preserve-write-permissions-in-migration-entries 2006-04-27 02:34:09.000000000 -0700 +++ devel-akpm/include/linux/swapops.h 2006-04-27 03:10:50.000000000 -0700 @@ -69,15 +69,22 @@ static inline pte_t swp_entry_to_pte(swp } #ifdef CONFIG_MIGRATION -static inline swp_entry_t make_migration_entry(struct page *page) +static inline swp_entry_t make_migration_entry(struct page *page, int write) { BUG_ON(!PageLocked(page)); - return swp_entry(SWP_TYPE_MIGRATION, page_to_pfn(page)); + return swp_entry(write ? SWP_MIGRATION_WRITE : SWP_MIGRATION_READ, + page_to_pfn(page)); } static inline int is_migration_entry(swp_entry_t entry) { - return unlikely(swp_type(entry) == SWP_TYPE_MIGRATION); + return unlikely(swp_type(entry) == SWP_MIGRATION_READ || + swp_type(entry) == SWP_MIGRATION_WRITE); +} + +static inline int is_write_migration_entry(swp_entry_t entry) +{ + return swp_type(entry) == SWP_MIGRATION_WRITE; } static inline struct page *migration_entry_to_page(swp_entry_t entry) @@ -94,7 +101,7 @@ static inline struct page *migration_ent extern void migration_entry_wait(swp_entry_t, pte_t *); #else -#define make_migration_entry(page) swp_entry(0, 0) +#define make_migration_entry(page, write) swp_entry(0, 0) #define is_migration_entry(swp) 0 #define migration_entry_to_page(swp) NULL static inline void migration_entry_wait(swp_entry_t entry, pte_t *ptep) { } diff -puN mm/migrate.c~preserve-write-permissions-in-migration-entries mm/migrate.c --- devel/mm/migrate.c~preserve-write-permissions-in-migration-entries 2006-04-27 02:34:09.000000000 -0700 +++ devel-akpm/mm/migrate.c 2006-04-27 03:10:44.000000000 -0700 @@ -167,7 +167,10 @@ static void remove_migration_pte(struct inc_mm_counter(mm, anon_rss); get_page(new); - set_pte_at(mm, addr, ptep, pte_mkold(mk_pte(new, vma->vm_page_prot))); + pte = pte_mkold(mk_pte(new, vma->vm_page_prot)); + if (is_write_migration_entry(entry)) + pte = pte_mkwrite(pte); + set_pte_at(mm, addr, ptep, pte); page_add_anon_rmap(new, vma, addr); out: pte_unmap_unlock(pte, ptl); diff -puN mm/rmap.c~preserve-write-permissions-in-migration-entries mm/rmap.c --- devel/mm/rmap.c~preserve-write-permissions-in-migration-entries 2006-04-27 02:34:09.000000000 -0700 +++ devel-akpm/mm/rmap.c 2006-04-27 02:34:09.000000000 -0700 @@ -602,7 +602,7 @@ static int try_to_unmap_one(struct page * pte is removed and then restart fault handling. */ BUG_ON(!migration); - entry = make_migration_entry(page); + entry = make_migration_entry(page, pte_write(pteval)); } set_pte_at(mm, address, pte, swp_entry_to_pte(entry)); BUG_ON(pte_file(*pte)); _ Patches currently in -mm which might be from clameter@xxxxxxx are origin.patch page-migration-make-do_swap_page-redo-the-fault.patch slab-extract-cache_free_alien-from-__cache_free.patch migration-remove-unnecessary-pageswapcache-checks.patch preserve-write-permissions-in-migration-entries.patch migration_entry_wait-use-the-pte-lock-instead-of-the-anon_vma-lock.patch read-write-migration-entries-implement-correct-behavior-in-copy_one_pte.patch read-write-migration-entries-make-mprotect-convert-write-migration.patch read-write-migration-entries-make-mprotect-convert-write-migration-fix.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html