Eliminating bounce buffers

Jamie Lokier lkd en tantalophile.demon.co.uk
Sab Ene 29 06:49:37 CST 2000


Larry Woodman wrote:
> The way it works is rather than copying high memory pages to and from
> low memory pages before scheduling IO, I map highmem pages into
> virtual addresses up in the vmalloc address space (via get_vm_area)
> and put this virtual address in the b_data field of the buffer_head
> for the duration of the IO operation.  Once the IO operation completes
> I unmap the highmem physical address from the virtual address so that
> it can be used by any other IO operation for a highmem page.

That's what kmap is supposed to do.  Possibly kmap isn't doing it yet,
but kmap is supposed to do that.

In particular, kunmap is much faster than vfree: it knows it doesn't
have to invalidate the TLB every time.

> I also changed virt_to_phys() and phys_to_virt() to that it properly
> deals with mapped highmem pages.  This all seems to work OK on my 4GB
> Intel box as long as the b_data field of the buffer_head contains a
> valid address.  I notice there is no more copying between low and
> hignmem pages, although I am still testing everything.

I'm sure this part is especially interesting.  I think this is what
Stephen Tweedie was intending to do with b_data all along, though
without such a large overhead in virt_to_phys and phys_to_virt due to
page table complexity.

It's nice that it works.  If it fixes current PAE problems that would be
even more brilliant: that would be motivation to do the kmap thing and
get rid of bounce buffers once and for all.

> This seems to be cleaner than doing IO to lower physical address pages
> and copying to and from highmem pages, or am I missing something
> here???  There is still a fair amount of work and cleanup for SMP and
> non-intel architectures, is this worth doing???

Speak to Stephen Tweedie.  He's written about doing this in a similar
way before.  But without having to modify virt_to_phys.

enjoy,
-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo en vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



Más información sobre la lista de distribución Ayuda