Subject: Re: Coallesce disk I/O
To: Gordon Waidhofer <gww@traakan.com>
From: Stephan Uphoff <ups@tree.com>
List: tech-kern
Date: 01/27/2004 13:25:32
"Gordon Waidhofer" wrote:
> 
> > > I/O coalescing by creating page aliases using the MMU is incredibly
> > > inefficient on some architectures, either because of the cache flushing
> > > it forces or because of the cost of MMU operations.
> > 
> > Yes, the remapping stuff is wasteful ....
> 
> pmap stuff is really expensive, especially on some
> architectures and especially on multiprocessors. And,
> as you say, in the end it amounts to very expensive
> pointer memory.

I agree - I/O coalescing through page aliasing is far from the ideal
solution. 
Scatter/Gather is a lot better - especially since it would allow
coalescing non-page aligned buffer. (mbuf chains for example)
It would also be nice to avoid uvm_pagermapin/uvm_pagermapin
calls by using physical addresses where possible.

FYI: The newest i386 pmap (1.168) avoids expensive TLB flushes on mappings 
never
touched by the CPU. (To optimize for DMA only mappings) This makes the page
aliasing trick a *LOT* less expensive on i386 SMP.

> As you say, the rub is all the data structures
> for DMA setup. For example, the SCSI request has
> but one dataprt/datalen pair. Changing the request
> structure means a tear-up of a helluva lot of code.
>
> Mighty deep rabbit hole.

Well - with Chris's patches you can easily take a look at the bottom of 
the hole to see if there is any gold there or just a dead rabbit ;-)
Once you can document a gold find - you might find more helping
hands to bring in the heavy mining equipment.

	Stephan