Re: Kernel virtual memory?

Bryn Paul Arnold Jones (bpaj@gytha.demon.co.uk)
Sat, 9 Aug 1997 01:23:28 +0100 (BST)


-----BEGIN PGP SIGNED MESSAGE-----

On Fri, 8 Aug 1997, Rauli Ruohonen wrote:

> In article <Pine.LNX.3.96.970808101142.607A-100000@gytha.demon.co.uk>,
> Bryn Paul Arnold Jones wrote:
>
> >1. Use the CPU VM hardware to make a virtual address physically be <16M
> > (but there's no real point, except to make a bounce buffer that doesn't
> > cost any coping).
>
> Hmm? Sounds funny :)
>

Ok, driver X has all it's memory at 21 Mb (say), and wants to use dma.
Normally it's going to have to get a bit of DMAable memory, and copy from
there to the place it wants it. What if it gets the DMAable memory, and
re-maps it where it wants it ? You just lost the copy. Probably not
worth it although...

>
> >3. Move a chunk of memory from <16M, and use the VM hardware to make it
> > appear unmoved so you need not find/fix all references to it.
> >
> >I'm assuming 3 as 1 is only helpful in one case (I can think of), and 2
> >is generally unhelpful IMHO.
>
> Yep, the #3 is what I meant. And additionally you could make fragmented
> memory look like linear, so kmalloc(big_amount) would always work if there's
> "big_amount" of memory available, no matter how fragmented it is.
>

Hmm, that would be hard to keep track of IMHO

> >You could then have something like this happening:
> >
> >buf=kmalloc(some_memory, GFP_BUFFER);
> >make_dmaable(buf, some_memory);
>
> I thought more of something like buf=kmalloc(some_memory,GFP_DMA);
>

Hmm, well if it's only DMAable while you are doing the DMA you don't have
to fight all the other drivers for space under the 16M limit when you
alloc the buffer (as currently when a driver gets a DMAable bit of memory
it holds on to it), and it's less virtual re-mappings to track. I don't
know how hard it is/would be to track this, but it's shorly easier to
track (say) 5 DMA enabled buffers than to track all the DMAable buffers.

Anyway it's all moot as I can't code it, and no one is going to start with
this as a pet project (unless you can code it;).

Bryn
- --
PGP Pub key http://www.gytha.demon.co.uk/pubkey.asc ID: 1024/30AF2D69
On-line, adj.: FP: FC 4E 41 9E 64 C3 AB 28 A3 5A 57 F8 CC D9 A7 B8
The idea that a human being should always be accessible to a computer.

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv
Comment: Probably (spelt 'Proberbly') requires PGP version 2.6 or later ;)

iQCVAwUBM+u4hesaGi8wry1pAQFb6QQAnWZ1SuE9mwhkwP+NiKpH5YxHymOggkc+
srIn+jn/uATcDP4Z0zsqtswkQ8nrrWmG3r6yhiUto89WhAepE//W55WWwMVbPF4T
/kzdfs6GSYOiVzBhA5ozQZBWnwnVY09QJZ+i6YAaJYHBC7labBPfxXM89x3S2Xyw
haVHyYWimqg=
=LSqC
-----END PGP SIGNATURE-----