diff for duplicates of <20090814201311.GA453@pengutronix.de> diff --git a/a/1.txt b/N1/1.txt index cdbe750..d938abd 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -236,9 +236,3 @@ index 4aa9eea..1043938 100644 -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ | - --- -To unsubscribe, send a message with 'unsubscribe linux-mm' in -the body to majordomo@kvack.org. For more info on Linux MM, -see: http://www.linux-mm.org/ . -Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> diff --git a/a/content_digest b/N1/content_digest index a1605ab..3a0c597 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -255,12 +255,6 @@ "\n" "-- \n" "Pengutronix e.K. | Uwe Kleine-K\303\266nig |\n" - "Industrial Linux Solutions | http://www.pengutronix.de/ |\n" - "\n" - "--\n" - "To unsubscribe, send a message with 'unsubscribe linux-mm' in\n" - "the body to majordomo@kvack.org. For more info on Linux MM,\n" - "see: http://www.linux-mm.org/ .\n" - "Don't email: <a href=mailto:\"dont@kvack.org\"> email@kvack.org </a>" + Industrial Linux Solutions | http://www.pengutronix.de/ | -4efb55bd0da57e054621b43b26e9892948db073d8b7731b1329320c268ed3fe6 +53892a4021feb8a530090549c10aee80505b7d713a87ee424a83b4ba849c1977
diff --git a/a/1.txt b/N2/1.txt index cdbe750..3f9f0b7 100644 --- a/a/1.txt +++ b/N2/1.txt @@ -22,223 +22,3 @@ have a machine with highmem. Best regards Uwe - ->From fafb2e9964cd01535a61f20a45093ba053169f06 Mon Sep 17 00:00:00 2001 -From: =?utf-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de> -Date: Fri, 14 Aug 2009 21:45:55 +0200 -Subject: [PATCH] Fix kmap_high_get() as kmap locking is gone -MIME-Version: 1.0 -Content-Type: text/plain; charset=utf-8 -Content-Transfer-Encoding: 8bit - -This has the pros of both Peter's and my patch: - -- It obsoletes ARCH_NEEDS_KMAP_HIGH_GET without introducing a big - overhead for the archs not having defined that symbol. -- no code duplication between kmap_high_get and kmap_high -- a nice kmap_high_put function that does the same as kunmap_high - without accounting -- no compiler warning about mismatched declarations - -Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> -Cc: Nicolas Pitre <nico@marvell.com> -Cc: MinChan Kim <minchan.kim@gmail.com> -Cc: Andrew Morton <akpm@linux-foundation.org> -Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> -Cc: Ingo Molnar <mingo@elte.hu> -Cc: Thomas Gleixner <tglx@linutronix.de> -Cc: Li Zefan <lizf@cn.fujitsu.com> -Cc: Jens Axboe <jens.axboe@oracle.com> -Cc: linux-mm@kvack.org -Cc: linux-kernel@vger.kernel.org ---- - arch/arm/include/asm/highmem.h | 3 +- - arch/arm/mm/dma-mapping.c | 2 +- - mm/highmem.c | 98 +++++++++++++++++----------------------- - 3 files changed, 43 insertions(+), 60 deletions(-) - -diff --git a/arch/arm/include/asm/highmem.h b/arch/arm/include/asm/highmem.h -index 7f36d00..2082ed8 100644 ---- a/arch/arm/include/asm/highmem.h -+++ b/arch/arm/include/asm/highmem.h -@@ -15,10 +15,9 @@ - - extern pte_t *pkmap_page_table; - --#define ARCH_NEEDS_KMAP_HIGH_GET -- - extern void *kmap_high(struct page *page); - extern void *kmap_high_get(struct page *page); -+extern void kmap_high_put(struct page *page); - extern void kunmap_high(struct page *page); - - extern void *kmap(struct page *page); -diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c -index 510c179..d71aff9 100644 ---- a/arch/arm/mm/dma-mapping.c -+++ b/arch/arm/mm/dma-mapping.c -@@ -551,7 +551,7 @@ static void dma_cache_maint_contiguous(struct page *page, unsigned long offset, - if (vaddr) { - vaddr += offset; - inner_op(vaddr, vaddr + size); -- kunmap_high(page); -+ kmap_high_put(page); - } - } - -diff --git a/mm/highmem.c b/mm/highmem.c -index 4aa9eea..1043938 100644 ---- a/mm/highmem.c -+++ b/mm/highmem.c -@@ -75,26 +75,6 @@ pte_t * pkmap_page_table; - - static DECLARE_WAIT_QUEUE_HEAD(pkmap_wait); - -- --/* -- * Most architectures have no use for kmap_high_get(), so let's abstract -- * the disabling of IRQ out of the locking in that case to save on a -- * potential useless overhead. -- */ --#ifdef ARCH_NEEDS_KMAP_HIGH_GET --#define lock_kmap() spin_lock_irq(&kmap_lock) --#define unlock_kmap() spin_unlock_irq(&kmap_lock) --#define lock_kmap_any(flags) spin_lock_irqsave(&kmap_lock, flags) --#define unlock_kmap_any(flags) spin_unlock_irqrestore(&kmap_lock, flags) --#else --#define lock_kmap() spin_lock(&kmap_lock) --#define unlock_kmap() spin_unlock(&kmap_lock) --#define lock_kmap_any(flags) \ -- do { spin_lock(&kmap_lock); (void)(flags); } while (0) --#define unlock_kmap_any(flags) \ -- do { spin_unlock(&kmap_lock); (void)(flags); } while (0) --#endif -- - /* - * Try to free a given kmap slot. - * -@@ -313,22 +293,32 @@ static void kunmap_account(void) - wake_up(&pkmap_wait); - } - --void *kmap_high(struct page *page) -+/** -+ * kmap_high_get - pin a highmem page into memory -+ * @page: &struct page to pin -+ * -+ * Returns the page's current virtual memory address, or NULL if no mapping -+ * exists. When and only when a non null address is returned then a -+ * matching call to kmap_high_put() is necessary. -+ * -+ * This can be called from any context. -+ */ -+void *kmap_high_get(struct page *page) - { - unsigned long vaddr; - -- -- kmap_account(); - again: - vaddr = (unsigned long)page_address(page); - if (vaddr) { - atomic_t *counter = &pkmap_count[PKMAP_NR(vaddr)]; - if (atomic_inc_not_zero(counter)) { - /* -- * atomic_inc_not_zero implies a (memory) barrier on success -- * so page address will be reloaded. -+ * atomic_inc_not_zero implies a (memory) barrier on -+ * success, so page address will be reloaded. - */ -- unsigned long vaddr2 = (unsigned long)page_address(page); -+ unsigned long vaddr2 = -+ (unsigned long)page_address(page); -+ - if (likely(vaddr == vaddr2)) - return (void *)vaddr; - -@@ -345,46 +335,40 @@ again: - } - } - -+ return NULL; -+} -+EXPORT_SYMBOL(kmap_high_get); -+ -+void kmap_high_put(struct page *page) -+{ -+ unsigned long vaddr = (unsigned long)page_address(page); -+ -+ BUG_ON(!vaddr); -+ pkmap_put(&pkmap_count[PKMAP_NR(vaddr)]); -+} -+EXPORT_SYMBOL(kmap_high_put); -+ -+void *kmap_high(struct page *page) -+{ -+ unsigned long vaddr; -+ -+ kmap_account(); -+again: -+ vaddr = (unsigned long)kmap_high_get(page); -+ if (vaddr) -+ return (void *)vaddr; -+ - vaddr = pkmap_insert(page); - if (!vaddr) - goto again; - - return (void *)vaddr; - } -- - EXPORT_SYMBOL(kmap_high); - --#ifdef ARCH_NEEDS_KMAP_HIGH_GET --/** -- * kmap_high_get - pin a highmem page into memory -- * @page: &struct page to pin -- * -- * Returns the page's current virtual memory address, or NULL if no mapping -- * exists. When and only when a non null address is returned then a -- * matching call to kunmap_high() is necessary. -- * -- * This can be called from any context. -- */ --void *kmap_high_get(struct page *page) --{ -- unsigned long vaddr, flags; -- -- lock_kmap_any(flags); -- vaddr = (unsigned long)page_address(page); -- if (vaddr) { -- BUG_ON(atomic_read(&pkmap_count[PKMAP_NR(vaddr)]) < 1); -- atomic_add(1, pkmap_count[PKMAP_NR(vaddr)]); -- } -- unlock_kmap_any(flags); -- return (void*) vaddr; --} --#endif -- -- void kunmap_high(struct page *page) -+void kunmap_high(struct page *page) - { -- unsigned long vaddr = (unsigned long)page_address(page); -- BUG_ON(!vaddr); -- pkmap_put(&pkmap_count[PKMAP_NR(vaddr)]); -+ kmap_high_put(page); - kunmap_account(); - } - --- -1.6.3.3 - - - --- -Pengutronix e.K. | Uwe Kleine-König | -Industrial Linux Solutions | http://www.pengutronix.de/ | - --- -To unsubscribe, send a message with 'unsubscribe linux-mm' in -the body to majordomo@kvack.org. For more info on Linux MM, -see: http://www.linux-mm.org/ . -Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> diff --git a/a/content_digest b/N2/content_digest index a1605ab..89f7f6c 100644 --- a/a/content_digest +++ b/N2/content_digest @@ -41,226 +41,6 @@ "have a machine with highmem.\n" "\n" "Best regards\n" - "Uwe\n" - "\n" - ">From fafb2e9964cd01535a61f20a45093ba053169f06 Mon Sep 17 00:00:00 2001\n" - "From: =?utf-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>\n" - "Date: Fri, 14 Aug 2009 21:45:55 +0200\n" - "Subject: [PATCH] Fix kmap_high_get() as kmap locking is gone\n" - "MIME-Version: 1.0\n" - "Content-Type: text/plain; charset=utf-8\n" - "Content-Transfer-Encoding: 8bit\n" - "\n" - "This has the pros of both Peter's and my patch:\n" - "\n" - "- It obsoletes ARCH_NEEDS_KMAP_HIGH_GET without introducing a big\n" - " overhead for the archs not having defined that symbol.\n" - "- no code duplication between kmap_high_get and kmap_high\n" - "- a nice kmap_high_put function that does the same as kunmap_high\n" - " without accounting\n" - "- no compiler warning about mismatched declarations\n" - "\n" - "Signed-off-by: Uwe Kleine-K\303\266nig <u.kleine-koenig@pengutronix.de>\n" - "Cc: Nicolas Pitre <nico@marvell.com>\n" - "Cc: MinChan Kim <minchan.kim@gmail.com>\n" - "Cc: Andrew Morton <akpm@linux-foundation.org>\n" - "Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>\n" - "Cc: Ingo Molnar <mingo@elte.hu>\n" - "Cc: Thomas Gleixner <tglx@linutronix.de>\n" - "Cc: Li Zefan <lizf@cn.fujitsu.com>\n" - "Cc: Jens Axboe <jens.axboe@oracle.com>\n" - "Cc: linux-mm@kvack.org\n" - "Cc: linux-kernel@vger.kernel.org\n" - "---\n" - " arch/arm/include/asm/highmem.h | 3 +-\n" - " arch/arm/mm/dma-mapping.c | 2 +-\n" - " mm/highmem.c | 98 +++++++++++++++++-----------------------\n" - " 3 files changed, 43 insertions(+), 60 deletions(-)\n" - "\n" - "diff --git a/arch/arm/include/asm/highmem.h b/arch/arm/include/asm/highmem.h\n" - "index 7f36d00..2082ed8 100644\n" - "--- a/arch/arm/include/asm/highmem.h\n" - "+++ b/arch/arm/include/asm/highmem.h\n" - "@@ -15,10 +15,9 @@\n" - " \n" - " extern pte_t *pkmap_page_table;\n" - " \n" - "-#define ARCH_NEEDS_KMAP_HIGH_GET\n" - "-\n" - " extern void *kmap_high(struct page *page);\n" - " extern void *kmap_high_get(struct page *page);\n" - "+extern void kmap_high_put(struct page *page);\n" - " extern void kunmap_high(struct page *page);\n" - " \n" - " extern void *kmap(struct page *page);\n" - "diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c\n" - "index 510c179..d71aff9 100644\n" - "--- a/arch/arm/mm/dma-mapping.c\n" - "+++ b/arch/arm/mm/dma-mapping.c\n" - "@@ -551,7 +551,7 @@ static void dma_cache_maint_contiguous(struct page *page, unsigned long offset,\n" - " \t\tif (vaddr) {\n" - " \t\t\tvaddr += offset;\n" - " \t\t\tinner_op(vaddr, vaddr + size);\n" - "-\t\t\tkunmap_high(page);\n" - "+\t\t\tkmap_high_put(page);\n" - " \t\t}\n" - " \t}\n" - " \n" - "diff --git a/mm/highmem.c b/mm/highmem.c\n" - "index 4aa9eea..1043938 100644\n" - "--- a/mm/highmem.c\n" - "+++ b/mm/highmem.c\n" - "@@ -75,26 +75,6 @@ pte_t * pkmap_page_table;\n" - " \n" - " static DECLARE_WAIT_QUEUE_HEAD(pkmap_wait);\n" - " \n" - "-\n" - "-/*\n" - "- * Most architectures have no use for kmap_high_get(), so let's abstract\n" - "- * the disabling of IRQ out of the locking in that case to save on a\n" - "- * potential useless overhead.\n" - "- */\n" - "-#ifdef ARCH_NEEDS_KMAP_HIGH_GET\n" - "-#define lock_kmap() spin_lock_irq(&kmap_lock)\n" - "-#define unlock_kmap() spin_unlock_irq(&kmap_lock)\n" - "-#define lock_kmap_any(flags) spin_lock_irqsave(&kmap_lock, flags)\n" - "-#define unlock_kmap_any(flags) spin_unlock_irqrestore(&kmap_lock, flags)\n" - "-#else\n" - "-#define lock_kmap() spin_lock(&kmap_lock)\n" - "-#define unlock_kmap() spin_unlock(&kmap_lock)\n" - "-#define lock_kmap_any(flags) \\\n" - "-\t\tdo { spin_lock(&kmap_lock); (void)(flags); } while (0)\n" - "-#define unlock_kmap_any(flags) \\\n" - "-\t\tdo { spin_unlock(&kmap_lock); (void)(flags); } while (0)\n" - "-#endif\n" - "-\n" - " /*\n" - " * Try to free a given kmap slot.\n" - " *\n" - "@@ -313,22 +293,32 @@ static void kunmap_account(void)\n" - " \twake_up(&pkmap_wait);\n" - " }\n" - " \n" - "-void *kmap_high(struct page *page)\n" - "+/**\n" - "+ * kmap_high_get - pin a highmem page into memory\n" - "+ * @page: &struct page to pin\n" - "+ *\n" - "+ * Returns the page's current virtual memory address, or NULL if no mapping\n" - "+ * exists. When and only when a non null address is returned then a\n" - "+ * matching call to kmap_high_put() is necessary.\n" - "+ *\n" - "+ * This can be called from any context.\n" - "+ */\n" - "+void *kmap_high_get(struct page *page)\n" - " {\n" - " \tunsigned long vaddr;\n" - " \n" - "-\n" - "-\tkmap_account();\n" - " again:\n" - " \tvaddr = (unsigned long)page_address(page);\n" - " \tif (vaddr) {\n" - " \t\tatomic_t *counter = &pkmap_count[PKMAP_NR(vaddr)];\n" - " \t\tif (atomic_inc_not_zero(counter)) {\n" - " \t\t\t/*\n" - "-\t\t\t * atomic_inc_not_zero implies a (memory) barrier on success\n" - "-\t\t\t * so page address will be reloaded.\n" - "+\t\t\t * atomic_inc_not_zero implies a (memory) barrier on\n" - "+\t\t\t * success, so page address will be reloaded.\n" - " \t\t\t */\n" - "-\t\t\tunsigned long vaddr2 = (unsigned long)page_address(page);\n" - "+\t\t\tunsigned long vaddr2 =\n" - "+\t\t\t\t(unsigned long)page_address(page);\n" - "+\n" - " \t\t\tif (likely(vaddr == vaddr2))\n" - " \t\t\t\treturn (void *)vaddr;\n" - " \n" - "@@ -345,46 +335,40 @@ again:\n" - " \t\t}\n" - " \t}\n" - " \n" - "+\treturn NULL;\n" - "+}\n" - "+EXPORT_SYMBOL(kmap_high_get);\n" - "+\n" - "+void kmap_high_put(struct page *page)\n" - "+{\n" - "+\tunsigned long vaddr = (unsigned long)page_address(page);\n" - "+\n" - "+\tBUG_ON(!vaddr);\n" - "+\tpkmap_put(&pkmap_count[PKMAP_NR(vaddr)]);\n" - "+}\n" - "+EXPORT_SYMBOL(kmap_high_put);\n" - "+\n" - "+void *kmap_high(struct page *page)\n" - "+{\n" - "+\tunsigned long vaddr;\n" - "+\n" - "+\tkmap_account();\n" - "+again:\n" - "+\tvaddr = (unsigned long)kmap_high_get(page);\n" - "+\tif (vaddr)\n" - "+\t\treturn (void *)vaddr;\n" - "+\n" - " \tvaddr = pkmap_insert(page);\n" - " \tif (!vaddr)\n" - " \t\tgoto again;\n" - " \n" - " \treturn (void *)vaddr;\n" - " }\n" - "-\n" - " EXPORT_SYMBOL(kmap_high);\n" - " \n" - "-#ifdef ARCH_NEEDS_KMAP_HIGH_GET\n" - "-/**\n" - "- * kmap_high_get - pin a highmem page into memory\n" - "- * @page: &struct page to pin\n" - "- *\n" - "- * Returns the page's current virtual memory address, or NULL if no mapping\n" - "- * exists. When and only when a non null address is returned then a\n" - "- * matching call to kunmap_high() is necessary.\n" - "- *\n" - "- * This can be called from any context.\n" - "- */\n" - "-void *kmap_high_get(struct page *page)\n" - "-{\n" - "-\tunsigned long vaddr, flags;\n" - "-\n" - "-\tlock_kmap_any(flags);\n" - "-\tvaddr = (unsigned long)page_address(page);\n" - "-\tif (vaddr) {\n" - "-\t\tBUG_ON(atomic_read(&pkmap_count[PKMAP_NR(vaddr)]) < 1);\n" - "-\t\tatomic_add(1, pkmap_count[PKMAP_NR(vaddr)]);\n" - "-\t}\n" - "-\tunlock_kmap_any(flags);\n" - "-\treturn (void*) vaddr;\n" - "-}\n" - "-#endif\n" - "-\n" - "- void kunmap_high(struct page *page)\n" - "+void kunmap_high(struct page *page)\n" - " {\n" - "-\tunsigned long vaddr = (unsigned long)page_address(page);\n" - "-\tBUG_ON(!vaddr);\n" - "-\tpkmap_put(&pkmap_count[PKMAP_NR(vaddr)]);\n" - "+\tkmap_high_put(page);\n" - " \tkunmap_account();\n" - " }\n" - " \n" - "-- \n" - "1.6.3.3\n" - "\n" - "\n" - "\n" - "-- \n" - "Pengutronix e.K. | Uwe Kleine-K\303\266nig |\n" - "Industrial Linux Solutions | http://www.pengutronix.de/ |\n" - "\n" - "--\n" - "To unsubscribe, send a message with 'unsubscribe linux-mm' in\n" - "the body to majordomo@kvack.org. For more info on Linux MM,\n" - "see: http://www.linux-mm.org/ .\n" - "Don't email: <a href=mailto:\"dont@kvack.org\"> email@kvack.org </a>" + Uwe -4efb55bd0da57e054621b43b26e9892948db073d8b7731b1329320c268ed3fe6 +ea4bf63e1d77358b893e7711c1dfa680c8f59ef44c72aa05d46ae963581bb643
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.