Linux PARISC architecture development
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@steeleye.com>
To: PARISC list <parisc-linux@lists.parisc-linux.org>
Subject: [parisc-linux] Proposed changes to flush_dcache_page to fix our shared ro mapping problem
Date: 23 Aug 2003 11:25:52 -0500	[thread overview]
Message-ID: <1061655953.1992.104.camel@mulgrave> (raw)

[-- Attachment #1: Type: text/plain, Size: 157 bytes --]

The attached should do it

(plus the fix to preserve the VM_MAYSHARE flag on remap).

I've verified that this fixes the glibc tst-mmap-eofsync test.

James


[-- Attachment #2: tmp.diff --]
[-- Type: text/plain, Size: 1346 bytes --]

===== arch/parisc/kernel/cache.c 1.4 vs edited =====
--- 1.4/arch/parisc/kernel/cache.c	Sat Mar  8 14:01:30 2003
+++ edited/arch/parisc/kernel/cache.c	Sat Aug 23 11:22:22 2003
@@ -232,7 +232,8 @@
 
 	if (!page->mapping)
 		return;
-
+	/* check shared list first if it's not empty...it's usually
+	 * the shortest */
 	list_for_each(l, &page->mapping->i_mmap_shared) {
 		struct vm_area_struct *mpnt;
 		unsigned long off;
@@ -243,6 +244,33 @@
 		 * If this VMA is not in our MM, we can ignore it.
 		 */
 		if (mpnt->vm_mm != mm)
+			continue;
+
+		if (page->index < mpnt->vm_pgoff)
+			continue;
+
+		off = page->index - mpnt->vm_pgoff;
+		if (off >= (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT)
+			continue;
+
+		flush_cache_page(mpnt, mpnt->vm_start + (off << PAGE_SHIFT));
+
+		/* All user shared mappings should be equivalently mapped,
+		 * so once we've flushed one we should be ok
+		 */
+		return;
+	}
+
+	/* then check private mapping list for read only shared mappings
+	 * which are flagged by VM_MAYSHARE */
+	list_for_each(l, &page->mapping->i_mmap) {
+		struct vm_area_struct *mpnt;
+		unsigned long off;
+
+		mpnt = list_entry(l, struct vm_area_struct, shared);
+
+
+		if (mpnt->vm_mm != mm || !(mpnt->vm_flags & VM_MAYSHARE))
 			continue;
 
 		if (page->index < mpnt->vm_pgoff)

                 reply	other threads:[~2003-08-23 16:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1061655953.1992.104.camel@mulgrave \
    --to=james.bottomley@steeleye.com \
    --cc=parisc-linux@lists.parisc-linux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox