- swapless-v2-add-migration-swap-entries-fix.patch removed from -mm tree

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

 



The patch titled

     Implement lookup_swap_cache for migration entries

has been removed from the -mm tree.  Its filename is

     swapless-v2-add-migration-swap-entries-fix.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>

This undoes the optimization that resulted in a yield in do_swap_cache(). 
do_swap_cache() stays as is.  Instead we convert the migration entry to a
page * in lookup_swap_cache.

For the non swap case we need a special macro version of lookup_swap_cache
that is only capable of handling migration cache entries.

Signed-off-by: Christoph Lameter <claemter@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 include/linux/swap.h    |   14 +++++++++++++-
 include/linux/swapops.h |    2 +-
 mm/memory.c             |    5 -----
 mm/swap_state.c         |    7 +++++++
 4 files changed, 21 insertions(+), 7 deletions(-)

diff -puN include/linux/swap.h~swapless-v2-add-migration-swap-entries-fix include/linux/swap.h
--- devel/include/linux/swap.h~swapless-v2-add-migration-swap-entries-fix	2006-04-14 22:02:32.000000000 -0700
+++ devel-akpm/include/linux/swap.h	2006-04-14 22:07:19.000000000 -0700
@@ -300,7 +300,6 @@ static inline void disable_swap_token(vo
 #define swap_duplicate(swp)			/*NOTHING*/
 #define swap_free(swp)				/*NOTHING*/
 #define read_swap_cache_async(swp,vma,addr)	NULL
-#define lookup_swap_cache(swp)			NULL
 #define valid_swaphandles(swp, off)		0
 #define can_share_swap_page(p)			0
 #define move_to_swap_cache(p, swp)		1
@@ -309,6 +308,19 @@ static inline void disable_swap_token(vo
 #define delete_from_swap_cache(p)		/*NOTHING*/
 #define swap_token_default_timeout		0
 
+/*
+ * Must use a macro for lookup_swap_cache since the functions
+ * used are only available in certain contexts.
+ */
+#define lookup_swap_cache(__swp)				\
+({	struct page *p = NULL;					\
+	if (is_migration_entry(__swp)) {			\
+		p = migration_entry_to_page(__swp);		\
+		get_page(p);					\
+	}							\
+	p;							\
+})
+
 static inline int remove_exclusive_swap_page(struct page *p)
 {
 	return 0;
diff -puN include/linux/swapops.h~swapless-v2-add-migration-swap-entries-fix include/linux/swapops.h
--- devel/include/linux/swapops.h~swapless-v2-add-migration-swap-entries-fix	2006-04-14 22:02:32.000000000 -0700
+++ devel-akpm/include/linux/swapops.h	2006-04-14 22:07:19.000000000 -0700
@@ -77,7 +77,7 @@ static inline swp_entry_t make_migration
 
 static inline int is_migration_entry(swp_entry_t entry)
 {
-	return swp_type(entry) == SWP_TYPE_MIGRATION;
+	return unlikely(swp_type(entry) == SWP_TYPE_MIGRATION);
 }
 
 static inline struct page *migration_entry_to_page(swp_entry_t entry)
diff -puN mm/memory.c~swapless-v2-add-migration-swap-entries-fix mm/memory.c
--- devel/mm/memory.c~swapless-v2-add-migration-swap-entries-fix	2006-04-14 22:02:32.000000000 -0700
+++ devel-akpm/mm/memory.c	2006-04-14 22:02:32.000000000 -0700
@@ -1880,11 +1880,6 @@ static int do_swap_page(struct mm_struct
 
 	entry = pte_to_swp_entry(orig_pte);
 
-	if (unlikely(is_migration_entry(entry))) {
-		yield();
-		goto out;
-	}
-
 	page = lookup_swap_cache(entry);
 	if (!page) {
  		swapin_readahead(entry, address, vma);
diff -puN mm/swap_state.c~swapless-v2-add-migration-swap-entries-fix mm/swap_state.c
--- devel/mm/swap_state.c~swapless-v2-add-migration-swap-entries-fix	2006-04-14 22:02:32.000000000 -0700
+++ devel-akpm/mm/swap_state.c	2006-04-14 22:02:32.000000000 -0700
@@ -12,6 +12,7 @@
 #include <linux/swap.h>
 #include <linux/init.h>
 #include <linux/pagemap.h>
+#include <linux/swapops.h>
 #include <linux/buffer_head.h>
 #include <linux/backing-dev.h>
 #include <linux/pagevec.h>
@@ -299,6 +300,12 @@ struct page * lookup_swap_cache(swp_entr
 {
 	struct page *page;
 
+	if (is_migration_entry(entry)) {
+		page = migration_entry_to_page(entry);
+		get_page(page);
+		return page;
+	}
+
 	page = find_get_page(&swapper_space, entry.val);
 
 	if (page)
_

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
migration-remove-unnecessary-pageswapcache-checks-fix.patch
swapless-v2-try_to_unmap-rename-ignrefs-to-migration.patch
swapless-v2-add-migration-swap-entries.patch
swapless-v2-add-migration-swap-entries-fix.patch
swapless-v2-make-try_to_unmap-create-migration-entries.patch
swapless-v2-rip-out-swap-portion-of-old-migration-code.patch
swapless-v2-revise-main-migration-logic.patch
preserve-write-permissions-in-migration-entries.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

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux