diff for duplicates of <53D62599.6000605@samsung.com> diff --git a/a/1.txt b/N1/1.txt index 5784045..fd587b5 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -74,92 +74,3 @@ I suppose trinity could change it, no? I've got the very same spew after setting In case if we are not going to get rid of debugfs interface I would better keep faul_around_bytes always roundded down, like in following patch: - - ->From f41b7777b29f06dc62f80526e5617cae82a38709 Mon Sep 17 00:00:00 2001 -From: Andrey Ryabinin <a.ryabinin@samsung.com> -Date: Mon, 28 Jul 2014 13:46:10 +0400 -Subject: [PATCH] mm: debugfs: move rounddown_pow_of_two() out from do_fault - path - -do_fault_around expects fault_around_bytes rounded down to nearest -page order. Instead of calling rounddown_pow_of_two every time -in fault_around_pages()/fault_around_mask() we could do round down -when user changes fault_around_bytes via debugfs interface. - -This also fixes bug when user set fault_around_bytes to 0. -Result of rounddown_pow_of_two(0) is not defined, therefore -fault_around_bytes == 0 doesn't work without this patch. - -Let's set fault_around_bytes to PAGE_SIZE if user sets to something -less than PAGE_SIZE - -Fixes: a9b0f861("mm: nominate faultaround area in bytes rather than page order") -Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com> -Cc: <stable@vger.kernel.org> # 3.15.x ---- - mm/memory.c | 19 +++++++++++-------- - 1 file changed, 11 insertions(+), 8 deletions(-) - -diff --git a/mm/memory.c b/mm/memory.c -index 7e8d820..e0c6fd6 100644 ---- a/mm/memory.c -+++ b/mm/memory.c -@@ -2758,20 +2758,16 @@ void do_set_pte(struct vm_area_struct *vma, unsigned long address, - update_mmu_cache(vma, address, pte); - } - --static unsigned long fault_around_bytes = 65536; -+static unsigned long fault_around_bytes = rounddown_pow_of_two(65536); - --/* -- * fault_around_pages() and fault_around_mask() round down fault_around_bytes -- * to nearest page order. It's what do_fault_around() expects to see. -- */ - static inline unsigned long fault_around_pages(void) - { -- return rounddown_pow_of_two(fault_around_bytes) / PAGE_SIZE; -+ return fault_around_bytes >> PAGE_SHIFT; - } - - static inline unsigned long fault_around_mask(void) - { -- return ~(rounddown_pow_of_two(fault_around_bytes) - 1) & PAGE_MASK; -+ return ~(fault_around_bytes - 1) & PAGE_MASK; - } - - -@@ -2782,11 +2778,18 @@ static int fault_around_bytes_get(void *data, u64 *val) - return 0; - } - -+/* -+ * fault_around_pages() and fault_around_mask() expects fault_around_bytes -+ * rounded down to nearest page order. It's what do_fault_around() expects to see. -+ */ - static int fault_around_bytes_set(void *data, u64 val) - { - if (val / PAGE_SIZE > PTRS_PER_PTE) - return -EINVAL; -- fault_around_bytes = val; -+ if (val > PAGE_SIZE) -+ fault_around_bytes = rounddown_pow_of_two(val); -+ else -+ fault_around_bytes = PAGE_SIZE; /* rounddown_pow_of_two(0) is undefined */ - return 0; - } - DEFINE_SIMPLE_ATTRIBUTE(fault_around_bytes_fops, --- -1.8.5.5 - - - - - - - --- -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 4167b29..a702dbf 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -101,95 +101,6 @@ "> \n" "\n" "In case if we are not going to get rid of debugfs interface I would better keep\n" - "faul_around_bytes always roundded down, like in following patch:\n" - "\n" - "\n" - ">From f41b7777b29f06dc62f80526e5617cae82a38709 Mon Sep 17 00:00:00 2001\n" - "From: Andrey Ryabinin <a.ryabinin@samsung.com>\n" - "Date: Mon, 28 Jul 2014 13:46:10 +0400\n" - "Subject: [PATCH] mm: debugfs: move rounddown_pow_of_two() out from do_fault\n" - " path\n" - "\n" - "do_fault_around expects fault_around_bytes rounded down to nearest\n" - "page order. Instead of calling rounddown_pow_of_two every time\n" - "in fault_around_pages()/fault_around_mask() we could do round down\n" - "when user changes fault_around_bytes via debugfs interface.\n" - "\n" - "This also fixes bug when user set fault_around_bytes to 0.\n" - "Result of rounddown_pow_of_two(0) is not defined, therefore\n" - "fault_around_bytes == 0 doesn't work without this patch.\n" - "\n" - "Let's set fault_around_bytes to PAGE_SIZE if user sets to something\n" - "less than PAGE_SIZE\n" - "\n" - "Fixes: a9b0f861(\"mm: nominate faultaround area in bytes rather than page order\")\n" - "Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>\n" - "Cc: <stable@vger.kernel.org> # 3.15.x\n" - "---\n" - " mm/memory.c | 19 +++++++++++--------\n" - " 1 file changed, 11 insertions(+), 8 deletions(-)\n" - "\n" - "diff --git a/mm/memory.c b/mm/memory.c\n" - "index 7e8d820..e0c6fd6 100644\n" - "--- a/mm/memory.c\n" - "+++ b/mm/memory.c\n" - "@@ -2758,20 +2758,16 @@ void do_set_pte(struct vm_area_struct *vma, unsigned long address,\n" - " \tupdate_mmu_cache(vma, address, pte);\n" - " }\n" - "\n" - "-static unsigned long fault_around_bytes = 65536;\n" - "+static unsigned long fault_around_bytes = rounddown_pow_of_two(65536);\n" - "\n" - "-/*\n" - "- * fault_around_pages() and fault_around_mask() round down fault_around_bytes\n" - "- * to nearest page order. It's what do_fault_around() expects to see.\n" - "- */\n" - " static inline unsigned long fault_around_pages(void)\n" - " {\n" - "-\treturn rounddown_pow_of_two(fault_around_bytes) / PAGE_SIZE;\n" - "+\treturn fault_around_bytes >> PAGE_SHIFT;\n" - " }\n" - "\n" - " static inline unsigned long fault_around_mask(void)\n" - " {\n" - "-\treturn ~(rounddown_pow_of_two(fault_around_bytes) - 1) & PAGE_MASK;\n" - "+\treturn ~(fault_around_bytes - 1) & PAGE_MASK;\n" - " }\n" - "\n" - "\n" - "@@ -2782,11 +2778,18 @@ static int fault_around_bytes_get(void *data, u64 *val)\n" - " \treturn 0;\n" - " }\n" - "\n" - "+/*\n" - "+ * fault_around_pages() and fault_around_mask() expects fault_around_bytes\n" - "+ * rounded down to nearest page order. It's what do_fault_around() expects to see.\n" - "+ */\n" - " static int fault_around_bytes_set(void *data, u64 val)\n" - " {\n" - " \tif (val / PAGE_SIZE > PTRS_PER_PTE)\n" - " \t\treturn -EINVAL;\n" - "-\tfault_around_bytes = val;\n" - "+\tif (val > PAGE_SIZE)\n" - "+\t\tfault_around_bytes = rounddown_pow_of_two(val);\n" - "+\telse\n" - "+\t\tfault_around_bytes = PAGE_SIZE; /* rounddown_pow_of_two(0) is undefined */\n" - " \treturn 0;\n" - " }\n" - " DEFINE_SIMPLE_ATTRIBUTE(fault_around_bytes_fops,\n" - "-- \n" - "1.8.5.5\n" - "\n" - "\n" - "\n" - "\n" - "\n" - "\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>" + faul_around_bytes always roundded down, like in following patch: -e295f9e0ddfd15acf472ed9c81b9026af9ffbaafce5deb161c223df31cafbbca +3d29761c7863791d43b39438237e558b9e402ca18c2d06dbe4cabcc8f5d3243a
diff --git a/a/1.txt b/N2/1.txt index 5784045..15cc6b6 100644 --- a/a/1.txt +++ b/N2/1.txt @@ -151,15 +151,3 @@ index 7e8d820..e0c6fd6 100644 DEFINE_SIMPLE_ATTRIBUTE(fault_around_bytes_fops, -- 1.8.5.5 - - - - - - - --- -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 4167b29..8cec19f 100644 --- a/a/content_digest +++ b/N2/content_digest @@ -178,18 +178,6 @@ " }\n" " DEFINE_SIMPLE_ATTRIBUTE(fault_around_bytes_fops,\n" "-- \n" - "1.8.5.5\n" - "\n" - "\n" - "\n" - "\n" - "\n" - "\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>" + 1.8.5.5 -e295f9e0ddfd15acf472ed9c81b9026af9ffbaafce5deb161c223df31cafbbca +0a396864b225795d83a571ec88cd310f90cabad837193280f2d63ebbf3b6a620
diff --git a/a/1.txt b/N3/1.txt index 5784045..8e2b918 100644 --- a/a/1.txt +++ b/N3/1.txt @@ -68,7 +68,7 @@ I suppose trinity could change it, no? I've got the very same spew after setting >> it, fault_around_bytes could be set to any value in range [1, 2*PAGE_SIZE - 1] >> instead of 0. > ->>From user point of view, 0 is perfectly fine. What about untested patch +>>>From user point of view, 0 is perfectly fine. What about untested patch > below? > @@ -151,15 +151,3 @@ index 7e8d820..e0c6fd6 100644 DEFINE_SIMPLE_ATTRIBUTE(fault_around_bytes_fops, -- 1.8.5.5 - - - - - - - --- -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/N3/content_digest index 4167b29..5a3a453 100644 --- a/a/content_digest +++ b/N3/content_digest @@ -96,7 +96,7 @@ ">> it, fault_around_bytes could be set to any value in range [1, 2*PAGE_SIZE - 1]\n" ">> instead of 0.\n" "> \n" - ">>From user point of view, 0 is perfectly fine. What about untested patch\n" + ">>>From user point of view, 0 is perfectly fine. What about untested patch\n" "> below?\n" "> \n" "\n" @@ -178,18 +178,6 @@ " }\n" " DEFINE_SIMPLE_ATTRIBUTE(fault_around_bytes_fops,\n" "-- \n" - "1.8.5.5\n" - "\n" - "\n" - "\n" - "\n" - "\n" - "\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>" + 1.8.5.5 -e295f9e0ddfd15acf472ed9c81b9026af9ffbaafce5deb161c223df31cafbbca +3f7396a280c2bd2929c988015c5b004466b1958d1963d9b033d693ebb0d8a655
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.