[Top] [All Lists]

Re: Promblem with PREF (prefetching) in memcpy

To: "Alan Cox" <>
Subject: Re: Promblem with PREF (prefetching) in memcpy
From: "Kevin D. Kissell" <>
Date: Fri, 4 Oct 2002 15:15:41 +0200
Cc: "Carsten Langgaard" <>, "Dominic Sweetman" <>, "Ralf Baechle" <>, <>
Original-recipient: rfc822;
References: <><> <><> <00fe01c26ba6$04943480$10eca8c0@grendel> <>
From: "Alan Cox" <>
> On Fri, 2002-10-04 at 14:00, Kevin D. Kissell wrote:
> > The issue isn't that anyone would deliberately use memcpy() in I/O
> > space.  Rather, it's that memcpy() prefetches quite a ways ahead,
> > and if one has I/O space assigned just after the end of physical
> > memory, Bad Things might happen on a perfectly legal memcpy()
> > that references the last couple hundred bytes of memory in a 
> > way that not even a clever and well-informed bus error handler 
> > could undo.
> Then your memcpy function is IMHO broken. Fix it to note prefetch beyond
> the end of the area you actually will copy and life should be a lot
> better

Which is excatly the point that Carsten was raising when he started this thread!

The question is how, i.e. throttle memcpy or thow away a "guard band" of RAM?


            Kevin K. 

<Prev in Thread] Current Thread [Next in Thread>