[Top] [All Lists]

Re: memcpy and prefetch

To: Michael Sundius <>
Subject: Re: memcpy and prefetch
From: David Daney <>
Date: Tue, 27 Jan 2009 15:07:45 -0800
Cc:, "VomLehn, David" <>,
In-reply-to: <>
Original-recipient: rfc822;
References: <>
User-agent: Thunderbird (X11/20090105)
Michael Sundius wrote:
I know this topic has been written about but so excuse me if I am redundant. I saw lots of talk in the archives but I don't know if a solution was ever arrived
at. so:

what is the current state of the use of prefetch in memcpy()? it seems that
it is #undef-ed if CONFIG_DMA_COHERENT is not turned on.

is this still because the memcpy does not check to prevent a prefetch of
addresses beyond the end of the buffer?

If so, what was the reason a solution was abandoned....

also  has anyone out there written a memcopy that does use prefetch
intelligently (for mips32 that is)?

The Cavium OCTEON port overrides the default memcpy and does use prefetch. It was recently merged (2.6.29-rc2). Look at octeon-memcpy.S

I have thought that memcpy could be generated by mm/page.c as copy_page and clear_page are.

David Daney

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