[RFC] [PATCH 3/5] Dynamically allocated pageflags - PageSwapCache conversion.

From: Nigel Cunningham
Date: Mon Jul 23 2007 - 09:19:42 EST


Switch PageSwapCache flag to use dynamically allocated pageflags.

Signed-off-by: Nigel Cunningham <nigel@xxxxxxxxxxxxxxxxxx>

include/linux/page-flags.h | 7 ++++---
mm/dyn_pageflags.c | 3 +++
2 files changed, 7 insertions(+), 3 deletions(-)
diff -ruNp 921-page-swap-cache-pageflag.patch-old/include/linux/page-flags.h 921-page-swap-cache-pageflag.patch-new/include/linux/page-flags.h
--- 921-page-swap-cache-pageflag.patch-old/include/linux/page-flags.h 2007-07-23 22:13:16.000000000 +1000
+++ 921-page-swap-cache-pageflag.patch-new/include/linux/page-flags.h 2007-07-23 22:13:18.000000000 +1000
@@ -260,9 +260,10 @@ static inline void __ClearPageTail(struc
#define __ClearPageHead(page) __ClearPageCompound(page)

#ifdef CONFIG_SWAP
-#define PageSwapCache(page) test_bit(PG_swapcache, &(page)->flags)
-#define SetPageSwapCache(page) set_bit(PG_swapcache, &(page)->flags)
-#define ClearPageSwapCache(page) clear_bit(PG_swapcache, &(page)->flags)
+extern struct dyn_pageflags dyn_SwapCache_map;
+#define PageSwapCache(page) test_dynpageflag(&dyn_SwapCache_map, page)
+#define SetPageSwapCache(page) set_dynpageflag(&dyn_SwapCache_map, page)
+#define ClearPageSwapCache(page) clear_dynpageflag(&dyn_SwapCache_map, page)
#else
#define PageSwapCache(page) 0
#endif
diff -ruNp 921-page-swap-cache-pageflag.patch-old/mm/dyn_pageflags.c 921-page-swap-cache-pageflag.patch-new/mm/dyn_pageflags.c
--- 921-page-swap-cache-pageflag.patch-old/mm/dyn_pageflags.c 2007-07-23 22:13:16.000000000 +1000
+++ 921-page-swap-cache-pageflag.patch-new/mm/dyn_pageflags.c 2007-07-23 22:13:18.000000000 +1000
@@ -114,6 +114,9 @@ static int dyn_pageflags_debug = 0;
for (zone_nr = 0; zone_nr < MAX_NR_ZONES; zone_nr++)

DECLARE_DYN_PAGEFLAGS(dyn_MappedToDisk_map);
+#ifdef CONFIG_SWAP
+DECLARE_DYN_PAGEFLAGS(dyn_SwapCache_map);
+#endif

/**
* dump_pagemap: Display the contents of a bitmap for debugging purposes.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/