All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Erdfelt <jerdfelt@valinux.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [Linux-ia64] Re: IA-64 XFree86 (was: XFree 4.0.1 module loading)
Date: Tue, 31 Oct 2000 00:26:37 +0000	[thread overview]
Message-ID: <marc-linux-ia64-105590678205641@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105590678205362@msgid-missing>

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

On Mon, Aug 21, 2000, David Mosberger <davidm@hpl.hp.com> wrote:
>   Mark> 2) No mechanism for the X-server to write combine memory and
>   Mark> no discussions on adding this to Linux as far as I can tell.
>   Mark> There needs to be a new flag to open() or mmap().  There
>   Mark> aren't any MTRRs.
> 
> I submitted a patch for the tdfx DRM module to map non-AGP stuff as
> write-combined (actually, I'm not 100% sure this is the right thing to
> do here; a DRM expert may want to double check this; it does seem to
> work fine on my machine).  See the latest Linux kernel patch.
> 
> Linus already agreed that it would be OK to add additional mmap()
> flags to indicate the memory attribute (normal vs. write-combine
> vs. uncached).  Walt says a patch to do this was developed as part of
> the XFree86 4.0 work at VA and promised to send me a patch.  I don't
> think I have received such a patch, but I'd be happy to merge it
> in. ;-)

Now that we have a stable platform, we were able to test the patch and
confirm the patch wasn't causing the stability problems we were seeing.

This gets a 3 times speed improvement over non write combined memory in
the tests Mark performed.

The patch is against 2.4.0-test9-ia64-001004

JE


[-- Attachment #2: mmap-wrcomb-noncached.patch --]
[-- Type: text/plain, Size: 2608 bytes --]

diff -ur linux-2.4.0-test9.orig/drivers/char/mem.c linux-2.4.0-test9/drivers/char/mem.c
--- linux-2.4.0-test9.orig/drivers/char/mem.c	Mon Sep 25 15:26:56 2000
+++ linux-2.4.0-test9/drivers/char/mem.c	Thu Oct 26 15:31:18 2000
@@ -198,8 +198,12 @@
 	 * through a file pointer that was marked O_SYNC will be
 	 * done non-cached.
 	 */
-	if (noncached_address(offset) || (file->f_flags & O_SYNC))
+	if (noncached_address(offset) || (file->f_flags & O_SYNC) ||
+	    vma->vm_flags & VM_NONCACHED)
 		vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
+
+	if (vma->vm_flags & VM_WRITECOMBINED)
+		vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
 
 	/*
 	 * Don't dump addresses that are not real memory to a core file.
diff -ur linux-2.4.0-test9.orig/include/asm-ia64/mman.h linux-2.4.0-test9/include/asm-ia64/mman.h
--- linux-2.4.0-test9.orig/include/asm-ia64/mman.h	Fri Apr 21 15:21:24 2000
+++ linux-2.4.0-test9/include/asm-ia64/mman.h	Thu Oct 26 15:04:01 2000
@@ -24,6 +24,9 @@
 #define MAP_LOCKED	0x2000		/* pages are locked */
 #define MAP_NORESERVE	0x4000		/* don't check for reservations */
 
+#define MAP_WRITECOMBINED 0x10000	/* Write combine the area */
+#define MAP_NONCACHED	0x20000		/* Don't cache the memory */
+
 #define MS_ASYNC	1		/* sync memory asynchronously */
 #define MS_INVALIDATE	2		/* invalidate the caches */
 #define MS_SYNC		4		/* synchronous memory sync */
diff -ur linux-2.4.0-test9.orig/include/linux/mm.h linux-2.4.0-test9/include/linux/mm.h
--- linux-2.4.0-test9.orig/include/linux/mm.h	Mon Oct  2 11:01:19 2000
+++ linux-2.4.0-test9/include/linux/mm.h	Thu Oct 26 15:30:56 2000
@@ -96,6 +96,9 @@
 #define VM_DONTCOPY	0x00020000      /* Do not copy this vma on fork */
 #define VM_DONTEXPAND	0x00040000	/* Cannot expand with mremap() */
 
+#define VM_WRITECOMBINED 0x00100000	/* Write combined */
+#define VM_NONCACHED	0x00200000	/* Noncached access */
+
 #define VM_STACK_FLAGS	0x00000177
 
 #define VM_READHINTMASK			(VM_SEQ_READ | VM_RAND_READ)
diff -ur linux-2.4.0-test9.orig/mm/mmap.c linux-2.4.0-test9/mm/mmap.c
--- linux-2.4.0-test9.orig/mm/mmap.c	Tue Aug 29 12:41:12 2000
+++ linux-2.4.0-test9/mm/mmap.c	Mon Oct 30 11:01:13 2000
@@ -151,6 +151,12 @@
 		_trans(prot, PROT_WRITE, VM_WRITE) |
 		_trans(prot, PROT_EXEC, VM_EXEC);
 	flag_bits =
+#ifdef MAP_WRITECOMBINED
+		_trans(flags, MAP_WRITECOMBINED, VM_WRITECOMBINED) |
+#endif
+#ifdef MAP_NONCACHED
+		_trans(flags, MAP_NONCACHED, VM_NONCACHED) |
+#endif
 		_trans(flags, MAP_GROWSDOWN, VM_GROWSDOWN) |
 		_trans(flags, MAP_DENYWRITE, VM_DENYWRITE) |
 		_trans(flags, MAP_EXECUTABLE, VM_EXECUTABLE);

      parent reply	other threads:[~2000-10-31  0:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-21 16:30 [Linux-ia64] Re: IA-64 XFree86 (was: XFree 4.0.1 module loading) Keith Packard
2000-08-21 16:35 ` Marc Aurele La France
2000-08-21 17:00 ` Jes Sorensen
2000-08-21 19:34 ` Mark Vojkovich
2000-08-21 21:02 ` Marc Aurele La France
2000-08-21 21:19 ` Bill Nottingham
2000-08-21 22:40 ` Mark Vojkovich
2000-08-22  1:29 ` David Mosberger
2000-08-22  2:38 ` Mark Vojkovich
2000-08-22 21:22 ` Johannes Erdfelt
2000-08-22 22:07 ` Johannes Erdfelt
2000-08-22 22:45 ` David Mosberger
2000-10-31  0:26 ` Johannes Erdfelt [this message]

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=marc-linux-ia64-105590678205641@msgid-missing \
    --to=jerdfelt@valinux.com \
    --cc=linux-ia64@vger.kernel.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 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.