diff for duplicates of <20090715220445.GA1823@cmpxchg.org> diff --git a/a/1.txt b/N1/1.txt index 38940be..1af2637 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -35,84 +35,3 @@ But we can get rid of the locked test-and-clear despite all the other issues, patch below. Hannes - ->From eee677ddea61b1331a3bd8e402a0d02437fe872a Mon Sep 17 00:00:00 2001 -From: Johannes Weiner <hannes@cmpxchg.org> -Date: Wed, 15 Jul 2009 23:40:28 +0200 -Subject: [patch] mm: non-atomic test-clear of PG_mlocked on free - -By the time PG_mlocked is cleared in the page freeing path, nobody -else is looking at our page->flags anymore. - -It is thus safe to make the test-and-clear non-atomic and thereby -removing an unnecessary and expensive operation from a hotpath. - -Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> ---- - include/linux/page-flags.h | 12 +++++++++--- - mm/page_alloc.c | 4 ++-- - 2 files changed, 11 insertions(+), 5 deletions(-) - -diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h -index e2e5ce5..10e6011 100644 ---- a/include/linux/page-flags.h -+++ b/include/linux/page-flags.h -@@ -158,6 +158,9 @@ static inline int TestSetPage##uname(struct page *page) \ - static inline int TestClearPage##uname(struct page *page) \ - { return test_and_clear_bit(PG_##lname, &page->flags); } - -+#define __TESTCLEARFLAG(uname, lname) \ -+static inline int __TestClearPage##uname(struct page *page) \ -+ { return __test_and_clear_bit(PG_##lname, &page->flags); } - - #define PAGEFLAG(uname, lname) TESTPAGEFLAG(uname, lname) \ - SETPAGEFLAG(uname, lname) CLEARPAGEFLAG(uname, lname) -@@ -184,6 +187,9 @@ static inline void __ClearPage##uname(struct page *page) { } - #define TESTCLEARFLAG_FALSE(uname) \ - static inline int TestClearPage##uname(struct page *page) { return 0; } - -+#define __TESTCLEARFLAG_FALSE(uname) \ -+static inline int __TestClearPage##uname(struct page *page) { return 0; } -+ - struct page; /* forward declaration */ - - TESTPAGEFLAG(Locked, locked) TESTSETFLAG(Locked, locked) -@@ -250,11 +256,11 @@ PAGEFLAG(Unevictable, unevictable) __CLEARPAGEFLAG(Unevictable, unevictable) - #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT - #define MLOCK_PAGES 1 - PAGEFLAG(Mlocked, mlocked) __CLEARPAGEFLAG(Mlocked, mlocked) -- TESTSCFLAG(Mlocked, mlocked) -+ TESTSCFLAG(Mlocked, mlocked) __TESTCLEARFLAG(Mlocked, mlocked) - #else - #define MLOCK_PAGES 0 --PAGEFLAG_FALSE(Mlocked) -- SETPAGEFLAG_NOOP(Mlocked) TESTCLEARFLAG_FALSE(Mlocked) -+PAGEFLAG_FALSE(Mlocked) SETPAGEFLAG_NOOP(Mlocked) -+ TESTCLEARFLAG_FALSE(Mlocked) __TESTCLEARFLAG_FALSE(Mlocked) - #endif - - #ifdef CONFIG_IA64_UNCACHED_ALLOCATOR -diff --git a/mm/page_alloc.c b/mm/page_alloc.c -index caa9268..b0c8758 100644 ---- a/mm/page_alloc.c -+++ b/mm/page_alloc.c -@@ -557,7 +557,7 @@ static void __free_pages_ok(struct page *page, unsigned int order) - unsigned long flags; - int i; - int bad = 0; -- int wasMlocked = TestClearPageMlocked(page); -+ int wasMlocked = __TestClearPageMlocked(page); - - kmemcheck_free_shadow(page, order); - -@@ -1021,7 +1021,7 @@ static void free_hot_cold_page(struct page *page, int cold) - struct zone *zone = page_zone(page); - struct per_cpu_pages *pcp; - unsigned long flags; -- int wasMlocked = TestClearPageMlocked(page); -+ int wasMlocked = __TestClearPageMlocked(page); - - kmemcheck_free_shadow(page, 0); - --- -1.6.3 diff --git a/a/content_digest b/N1/content_digest index c57a71a..5f214cc 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -51,87 +51,6 @@ "But we can get rid of the locked test-and-clear despite all the other\n" "issues, patch below.\n" "\n" - "\tHannes\n" - "\n" - ">From eee677ddea61b1331a3bd8e402a0d02437fe872a Mon Sep 17 00:00:00 2001\n" - "From: Johannes Weiner <hannes@cmpxchg.org>\n" - "Date: Wed, 15 Jul 2009 23:40:28 +0200\n" - "Subject: [patch] mm: non-atomic test-clear of PG_mlocked on free\n" - "\n" - "By the time PG_mlocked is cleared in the page freeing path, nobody\n" - "else is looking at our page->flags anymore.\n" - "\n" - "It is thus safe to make the test-and-clear non-atomic and thereby\n" - "removing an unnecessary and expensive operation from a hotpath.\n" - "\n" - "Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>\n" - "---\n" - " include/linux/page-flags.h | 12 +++++++++---\n" - " mm/page_alloc.c | 4 ++--\n" - " 2 files changed, 11 insertions(+), 5 deletions(-)\n" - "\n" - "diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h\n" - "index e2e5ce5..10e6011 100644\n" - "--- a/include/linux/page-flags.h\n" - "+++ b/include/linux/page-flags.h\n" - "@@ -158,6 +158,9 @@ static inline int TestSetPage##uname(struct page *page)\t\t\t\\\n" - " static inline int TestClearPage##uname(struct page *page)\t\t\\\n" - " \t\t{ return test_and_clear_bit(PG_##lname, &page->flags); }\n" - " \n" - "+#define __TESTCLEARFLAG(uname, lname)\t\t\t\t\t\\\n" - "+static inline int __TestClearPage##uname(struct page *page)\t\t\\\n" - "+\t\t{ return __test_and_clear_bit(PG_##lname, &page->flags); }\n" - " \n" - " #define PAGEFLAG(uname, lname) TESTPAGEFLAG(uname, lname)\t\t\\\n" - " \tSETPAGEFLAG(uname, lname) CLEARPAGEFLAG(uname, lname)\n" - "@@ -184,6 +187,9 @@ static inline void __ClearPage##uname(struct page *page) { }\n" - " #define TESTCLEARFLAG_FALSE(uname)\t\t\t\t\t\\\n" - " static inline int TestClearPage##uname(struct page *page) { return 0; }\n" - " \n" - "+#define __TESTCLEARFLAG_FALSE(uname)\t\t\t\t\t\\\n" - "+static inline int __TestClearPage##uname(struct page *page) { return 0; }\n" - "+\n" - " struct page;\t/* forward declaration */\n" - " \n" - " TESTPAGEFLAG(Locked, locked) TESTSETFLAG(Locked, locked)\n" - "@@ -250,11 +256,11 @@ PAGEFLAG(Unevictable, unevictable) __CLEARPAGEFLAG(Unevictable, unevictable)\n" - " #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT\n" - " #define MLOCK_PAGES 1\n" - " PAGEFLAG(Mlocked, mlocked) __CLEARPAGEFLAG(Mlocked, mlocked)\n" - "-\tTESTSCFLAG(Mlocked, mlocked)\n" - "+\tTESTSCFLAG(Mlocked, mlocked) __TESTCLEARFLAG(Mlocked, mlocked)\n" - " #else\n" - " #define MLOCK_PAGES 0\n" - "-PAGEFLAG_FALSE(Mlocked)\n" - "-\tSETPAGEFLAG_NOOP(Mlocked) TESTCLEARFLAG_FALSE(Mlocked)\n" - "+PAGEFLAG_FALSE(Mlocked) SETPAGEFLAG_NOOP(Mlocked)\n" - "+\tTESTCLEARFLAG_FALSE(Mlocked) __TESTCLEARFLAG_FALSE(Mlocked)\n" - " #endif\n" - " \n" - " #ifdef CONFIG_IA64_UNCACHED_ALLOCATOR\n" - "diff --git a/mm/page_alloc.c b/mm/page_alloc.c\n" - "index caa9268..b0c8758 100644\n" - "--- a/mm/page_alloc.c\n" - "+++ b/mm/page_alloc.c\n" - "@@ -557,7 +557,7 @@ static void __free_pages_ok(struct page *page, unsigned int order)\n" - " \tunsigned long flags;\n" - " \tint i;\n" - " \tint bad = 0;\n" - "-\tint wasMlocked = TestClearPageMlocked(page);\n" - "+\tint wasMlocked = __TestClearPageMlocked(page);\n" - " \n" - " \tkmemcheck_free_shadow(page, order);\n" - " \n" - "@@ -1021,7 +1021,7 @@ static void free_hot_cold_page(struct page *page, int cold)\n" - " \tstruct zone *zone = page_zone(page);\n" - " \tstruct per_cpu_pages *pcp;\n" - " \tunsigned long flags;\n" - "-\tint wasMlocked = TestClearPageMlocked(page);\n" - "+\tint wasMlocked = __TestClearPageMlocked(page);\n" - " \n" - " \tkmemcheck_free_shadow(page, 0);\n" - " \n" - "-- \n" - 1.6.3 + "\tHannes" -3e44de9701e84fe9f88dda5202e9439f64f439194a7617129baf127b586a771a +7fe6f5e5569c40fb8574bc67659ca9f1e4da6fb391cd79334f68704acc53317e
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.