"I don't understand how you would prefetch this page from the kernel
space"
"
  My means is not prefetch the page but use prefetch instruction 
  (e.g. __asm__ __volatile__( " prefetchnta %0" : : "m" (*addr)   ) ;// addr is 
fist parameter of pagefault handler, which caused page fault trap),  prefetch 
the content in the addr into cache line.
  " The page is mapped into the application's address space, not the
kernel's. There is no mechanism to prefetch a page that isn't mapped
into the address space of the executing context"
  Yes, I agree with you. 
  for example:  
  1.fd=open("/var/tmp/mmap.file",O_RDWR);
  2. volatile unsigned char* s=mmap(,,,,fd,0L);
  3.a =s[4096];
   the step 3 will cause pagefault trap, before returning to user space from 
pagefault handler, we may use prefetch instruction to load the data into cache 
line inadvance
   
  "As a further wrinkle, there's no guarantee that when you return from the
pagefault trap you'll be executing the application that caused the
pagefault. trap_rtt() makes a call to preempt(), scheduling a
different process on CPU.
"
  Yes I agree with you, it is possible sometimes.
   
  Thanks,
  Ma Ling
   
  [EMAIL PROTECTED] wrote:
  > "The user program would have trouble
> doing the prefetch,
> because it is often difficult to predict
> where page faults will happen
> and because a prefetch before
> the page fault will probably have no effect.
> "
> 
> The prefetch instruciton will execute in kernel space.
> 
> 
> 
> we add prefetch instruciton in pagefault handler after successfully
> geting physical memory ,becasuse we know the user programe will soon
> access the address again.

I don't understand how you would prefetch this page from the kernel
space. The page is mapped into the application's address space, not the
kernel's. There is no mechanism to prefetch a page that isn't mapped
into the address space of the executing context.

As a further wrinkle, there's no guarantee that when you return from the
pagefault trap you'll be executing the application that caused the
pagefault. trap_rtt() makes a call to preempt(), scheduling a
different process on CPU.

-j




       
---------------------------------
 Check out  the hottest 2008 models today at Yahoo! Autos.
_______________________________________________
perf-discuss mailing list
perf-discuss@opensolaris.org

Reply via email to