public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Jones <davej@suse.de>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Cc: Manfred Spraul <manfred@colorfullife.com>
Subject: [patch] Prefetching file_read_actor()
Date: Mon, 31 Dec 2001 03:32:20 +0000	[thread overview]
Message-ID: <20011231033220.A1686@suse.de> (raw)

After noticing file_read_actor() showing up in profiles quite
a bit, I grepped old l-k messages, and turned up a post by
Manfred Spraul in which he posted a patch using inline asm
to prefetch read data.  This was x86 specific in generic code,
so was a little hackish..
Now that we have the prefetch macros, I decided to play with
this a little tonight, and came up with this patch..


diff -urN --exclude-from=/home/davej/.exclude linux-2.5.2-pre5/mm/filemap.c linux-2.5/mm/filemap.c
--- linux-2.5.2-pre5/mm/filemap.c	Sun Dec 16 23:21:24 2001
+++ linux-2.5/mm/filemap.c	Mon Dec 31 03:22:51 2001
@@ -1570,6 +1570,15 @@
 		size = count;
 
 	kaddr = kmap(page);
+
+	if (size > 128) {
+		int i;
+		for(i=0; i<size; i+=64) {
+			prefetch (kaddr+offset);
+			prefetch (kaddr+offset+(L1_CACHE_BYTES*2));
+		}
+	}
+
 	left = __copy_to_user(desc->buf, kaddr + offset, size);
 	kunmap(page);
 	
The results are an earth shaking 5 seconds off a make dep bzImage
on my P3, I've not benched an Athlon (or other prefetch aware
architecture) yet, but I expect to see similar speed ups..

Comments ?

Dave.

-- 
Dave Jones.                    http://www.codemonkey.org.uk
SuSE Labs.

             reply	other threads:[~2001-12-31  3:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-31  3:32 Dave Jones [this message]
2001-12-31  5:44 ` [patch] Prefetching file_read_actor() Andrew Morton
2001-12-31 10:58   ` Manfred Spraul
2001-12-31 19:28     ` Andrew Morton
2001-12-31 19:47       ` Dave Jones
2001-12-31 20:40         ` Ryan Cumming
2002-01-01 10:29         ` Alan Cox
2002-01-01 12:45           ` Dave Jones
2002-01-01 15:26             ` Alan Cox
2002-01-01 10:30       ` Alan Cox
2002-01-01 11:08         ` Anton Blanchard
2001-12-31 20:31     ` Dave Jones
2001-12-31 13:00   ` Alan Cox
2001-12-31 12:50 ` Rik van Riel

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=20011231033220.A1686@suse.de \
    --to=davej@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    /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