lkml.org 
[lkml]   [1996]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Asynchronous read-ahead
   Date: 	Mon, 8 Apr 1996 22:34:55 +0000 (GMT)
From: Gerard Roudier <groudier@iplus.fr>

> Just an idea.. If we want asynchronous read-ahead, shouldn't it be done best
> by a kernel-thread?

Process context switching is bad since TLB must be invalidated.
I am not a Linux Guru. However if the switching to a kernel-thread invalidate
TLB on mono-processor machine, then I donnot agree with your idea.
On the other hand, I think that it is easy to implement asynchronous read_ahead
as simple asynchronous IO requests.

On the I386 a kernel thread switch does indeed flush the TLB (but tlb
flushes on the intel are cheap and Linus could optimize this away if
he wanted to) However on the Sparc, for example, a kernel thread
switch does not cost a TLB flush at all. It is as expensive as a
non-local goto basically, on the Sparc.

In fact, on the Sparc, in a case such as the following:

time 1) user thread pid=5 sleeps
time 2) kernel switches to kernel thread (kswapd or whatever)
time 3) kernel switches back to user thread pid=5

There will not be one TLB/cache flush generated (unless kswapd or
whatever kernel daemon messes with page tables, but that is a
completely different matter altogether).

Later,
David S. Miller
davem@caip.rutgers.edu


\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.035 / U:1.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site