All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <20160118114043.GA14531@node.shutemov.name>

diff --git a/a/1.txt b/N1/1.txt
index ddc2b57..fa51a20 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -52,3 +52,38 @@ On Mon, Jan 18, 2016 at 11:09:00AM +0100, Geert Uytterhoeven wrote:
 Ughh.
 
 Please, test this:
+
+>From 5ac27019f886eef033e84c9579e09099469ccbf9 Mon Sep 17 00:00:00 2001
+From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
+Date: Mon, 18 Jan 2016 14:32:49 +0300
+Subject: [PATCH] mm, proc: add workaround for old compilers
+
+For THP=n, HPAGE_PMD_NR in smaps_account() expands to BUILD_BUG().
+That's fine since this codepath is eliminated by modern compilers.
+
+But older compilers have not that efficient dead code elimination.
+It causes problem at least with gcc 4.1.2 on m68k.
+
+Let's replace HPAGE_PMD_NR with 1 << compound_order(page).
+
+Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
+Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
+---
+ fs/proc/task_mmu.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
+index 65a1b6c69c11..71ffc91060f6 100644
+--- a/fs/proc/task_mmu.c
++++ b/fs/proc/task_mmu.c
+@@ -468,7 +468,7 @@ struct mem_size_stats {
+ static void smaps_account(struct mem_size_stats *mss, struct page *page,
+ 		bool compound, bool young, bool dirty)
+ {
+-	int i, nr = compound ? HPAGE_PMD_NR : 1;
++	int i, nr = compound ? 1 << compound_order(page) : 1;
+ 	unsigned long size = nr * PAGE_SIZE;
+ 
+ 	if (PageAnon(page))
+-- 
+ Kirill A. Shutemov
diff --git a/a/content_digest b/N1/content_digest
index 6dfb0c3..bd83b63 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -76,6 +76,41 @@
  "\n"
  "Ughh.\n"
  "\n"
- Please, test this:
+ "Please, test this:\n"
+ "\n"
+ ">From 5ac27019f886eef033e84c9579e09099469ccbf9 Mon Sep 17 00:00:00 2001\n"
+ "From: \"Kirill A. Shutemov\" <kirill.shutemov@linux.intel.com>\n"
+ "Date: Mon, 18 Jan 2016 14:32:49 +0300\n"
+ "Subject: [PATCH] mm, proc: add workaround for old compilers\n"
+ "\n"
+ "For THP=n, HPAGE_PMD_NR in smaps_account() expands to BUILD_BUG().\n"
+ "That's fine since this codepath is eliminated by modern compilers.\n"
+ "\n"
+ "But older compilers have not that efficient dead code elimination.\n"
+ "It causes problem at least with gcc 4.1.2 on m68k.\n"
+ "\n"
+ "Let's replace HPAGE_PMD_NR with 1 << compound_order(page).\n"
+ "\n"
+ "Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>\n"
+ "Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>\n"
+ "---\n"
+ " fs/proc/task_mmu.c | 2 +-\n"
+ " 1 file changed, 1 insertion(+), 1 deletion(-)\n"
+ "\n"
+ "diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c\n"
+ "index 65a1b6c69c11..71ffc91060f6 100644\n"
+ "--- a/fs/proc/task_mmu.c\n"
+ "+++ b/fs/proc/task_mmu.c\n"
+ "@@ -468,7 +468,7 @@ struct mem_size_stats {\n"
+ " static void smaps_account(struct mem_size_stats *mss, struct page *page,\n"
+ " \t\tbool compound, bool young, bool dirty)\n"
+ " {\n"
+ "-\tint i, nr = compound ? HPAGE_PMD_NR : 1;\n"
+ "+\tint i, nr = compound ? 1 << compound_order(page) : 1;\n"
+ " \tunsigned long size = nr * PAGE_SIZE;\n"
+ " \n"
+ " \tif (PageAnon(page))\n"
+ "-- \n"
+  Kirill A. Shutemov
 
-289e5a3c8c505b24ad0deb5d0848f266edc858730a6dd8b20f4690712f7439f7
+ed1d125d97e627ca172cdac572fa71f6e8d96591947f4016a2c95ab79025cd94

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.