All of lore.kernel.org
 help / color / mirror / Atom feed
From: R.E.Wolff@BitWizard.nl (Rogier Wolff)
To: pcg@goof.com (Marc Lehmann)
Cc: linux-kernel@vger.rutgers.edu
Subject: Re: mmap() is slower than read() on SCSI/IDE on 2.0 and 2.1
Date: Sat, 19 Dec 1998 16:37:34 +0100 (MET)	[thread overview]
Message-ID: <199812191537.QAA03388@cave.bitwizard.nl> (raw)
In-Reply-To: <19981218010838.D28066@cerebro.laendle> from Marc Lehmann at "Dec 18, 98 01:08:38 am"

Marc Lehmann wrote:
> On Thu, Dec 17, 1998 at 06:52:50AM +0000, Linus Torvalds wrote:
> > Umm, the easiest hint is probably to just look at the faulting address. 
> > We have it available, after all. 
> > 
> > I suspect that such a simple heuristic would be fairly accurate, and it
> > can be coupled with other heuristics to further increase the accuracy. 
> 
> file copy, yes. But grep (and probably lots of others) don't access memory
> sequentially (as faster search algorithms exist)

A fast search algorithm, touches memory every n bytes where n is the
size of the largest constant string that you're searching for. 

That way "n" is typically small, so that you end up hitting the first
n bytes pretty often.

If you're acessing 

	struct blabla {
        int ...
	float ...
	char [];
	}

mmapped from a file, you might be looking for a certain float. As long
as you're doing a linear search, you'll again hit the first few bytes
of a page pretty often.


				Roger.

-- 
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
*   Never blow in a cat's ear because if you do, usually after three or  *
*   four times, they will bite your lips!  And they don't let go for at  *
*   least a minute. -- Lisa Coburn, age 9

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

       reply	other threads:[~1998-12-19 14:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <19981218010838.D28066@cerebro.laendle>
1998-12-19 15:37 ` Rogier Wolff [this message]
     [not found] <199812160115.CAA25065@max.phys.uu.nl>
1998-12-16 22:38 ` mmap() is slower than read() on SCSI/IDE on 2.0 and 2.1 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=199812191537.QAA03388@cave.bitwizard.nl \
    --to=r.e.wolff@bitwizard.nl \
    --cc=linux-kernel@vger.rutgers.edu \
    --cc=pcg@goof.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 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.