[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug 1336 (linux mm)] New - Cache flushing bug



http://distro.conectiva.com.br/bugzilla/show_bug.cgi?id=1336

--- shadow/1336	Thu Feb  8 03:22:03 2001
+++ shadow/1336.tmp.1710	Thu Feb  8 03:22:03 2001
@@ -0,0 +1,57 @@
++============================================================================+
+| Cache flushing bug                                                         |
++----------------------------------------------------------------------------+
+|        Bug #: 1336                        Product: Linux kernel MM         |
+|       Status: UNCONFIRMED                 Version: 2.4 (stable)            |
+|   Resolution:                            Platform: All                     |
+|     Severity: major                    OS/Version: Linux                   |
+|     Priority: P3                        Component: linux mm                |
++----------------------------------------------------------------------------+
+|  Assigned To: linux-mm-bugs@nl.linux.org                                   |
+|  Reported By: gniibe@m17n.org                                              |
+|      CC list: Cc:                                                          |
++----------------------------------------------------------------------------+
+|          URL:                                                              |
++============================================================================+
+|                              DESCRIPTION                                   |
+Platform: non-x86
+
+For the arch which cache system is not coherent, we need to
+flush the cache (my case is SH-4).  I think that current code
+has a bug in do_swap_page.
+
+It only flushs the cache after read_swap_cache.  If it hits
+lookup_swap_cache, the cache is not flushed.  If the page is
+read asynchronously (say, readahead), the page is left unflushed.
+
+Here's a patch to fix that.
+
+--- v2.4.1/mm/memory.c	Sun Jan 28 12:12:35 2001
++++ linux/mm/memory.c	Thu Feb  8 10:05:07 2001
+@@ -1033,9 +1033,6 @@ static int do_swap_page(struct mm_struct
+
+	unlock_kernel();
+
+	if (!page)
+
+		return -1;
+-
+-
+	flush_page_to_ram(page);
+-
+	flush_icache_page(vma, page);
+ 	}
+
+ 	mm->rss++;
+@@ -1053,6 +1050,8 @@ static int do_swap_page(struct mm_struct
+
+	pte = pte_mkwrite(pte_mkdirty(pte));
+ 	UnlockPage(page);
+
++
+flush_page_to_ram(page);
++
+flush_icache_page(vma, page);
+ 	set_pte(page_table, pte);
+ 	/* No need to invalidate - it was non-present before */
+ 	update_mmu_cache(vma, address, pte);
\ No newline at end of file

-
Linux-mm-bugs:  bugzilla list for the Linux-MM subsystem
Archive:        http://mail.nl.linux.org/linux-mm-bugs/
Web site:       http://www.linux.eu.org/Linux-MM/
Development:    linux-mm@kvack.org