From: Manfred Spraul <manfred@colorfullife.com>
To: Pavel Machek <pavel@suse.cz>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
Linus Torvalds <torvalds@transmeta.com>,
linux-kernel@vger.kernel.org
Subject: Re: [beta patch] SSE copy_page() / clear_page()
Date: Tue, 20 Feb 2001 22:16:15 +0100 [thread overview]
Message-ID: <3A92DE9F.3A2F14E@colorfullife.com> (raw)
In-Reply-To: <20010220183513.B5102@bug.ucw.cz> <E14VJjL-0000eK-00@the-village.bc.nu> <20010220215216.C17159@atrey.karlin.mff.cuni.cz>
Pavel Machek wrote:
>
> > > > + __asm__ __volatile__(
> > > > + "mov %1, %0\n\t"
> > > > + : "=r" (i)
> > > > + : "r" (kaddr+offset)); /* load tlb entry */
> > > > + for(i=0;i<size;i+=64) {
> > > > + __asm__ __volatile__(
> > > > + "prefetchnta (%1, %0)\n\t"
> > > > + "prefetchnta 32(%1, %0)\n\t"
> > > > + : /* no output */
> > > > + : "r" (i), "r" (kaddr+offset));
> > > > + }
> > > > + }
> > > > left = __copy_to_user(desc->buf, kaddr + offset, size);
> > > > kunmap(page);
> > >
> > > This seems bogus -- you need to handle faults --
> > > i.e. __prefetchnta_to_user() ;-).
> >
Ahm. That's file_read_actor, not file_write_actor ;-)
I'm prefetching the kernel space buffer.
> > It wants wrapping nicely. A generic prefetch and prefetchw does help some other
> > cases (scheduler for one).
> >
> > Does the prefetch instruction fault on PIII/PIV then - the K7 one appears not
> > to be a source of faults
>
> My fault. I was told that prefetch instructions are always
> non-faulting.
>
But there is another problem:
The tlb preloading with a simple 'mov' is not enough:
the Pentium III cpu decodes the 'mov', begins to load the tlb entry -
this will take at least several dozend cpu ticks.
But the cpu continues to decode further instructions. It sees the
'prefetchnta', notices that the tlb entry is not loaded and ignores the
next prefetchnta's (prefetch without tlb is turned into NOP).
--
Manfred
prev parent reply other threads:[~2001-02-20 21:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-02-09 22:17 [beta patch] SSE copy_page() / clear_page() Manfred Spraul
2001-02-09 22:40 ` Linus Torvalds
2001-02-09 23:03 ` Doug Ledford
2001-02-10 9:09 ` Manfred Spraul
2001-02-10 17:18 ` Doug Ledford
2001-02-10 18:00 ` Manfred Spraul
2001-02-10 18:18 ` Manfred Spraul
[not found] ` <200102092240.OAA15902@penguin.transmeta.com>
2001-02-14 22:37 ` Manfred Spraul
2001-02-16 15:27 ` Andrew Morton
2001-02-20 17:35 ` Pavel Machek
2001-02-20 20:49 ` Alan Cox
2001-02-20 20:52 ` Pavel Machek
2001-02-20 21:08 ` Alan Cox
2001-02-20 21:16 ` Manfred Spraul [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=3A92DE9F.3A2F14E@colorfullife.com \
--to=manfred@colorfullife.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@suse.cz \
--cc=torvalds@transmeta.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