Subject: Re: UVM - Kernel & User access question
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Eric Circlaeys <eric.c@mac.com>
List: tech-kern
Date: 10/17/2003 01:02:07
Thank you very for your answer!

On 16 oct. 03, at 20:30, der Mouse wrote:

>> I would like to use UVM to allocate large memory in kernel land.  I
>> used uao_create, round_page, uvm_map to allocate virtual space.
>
> As I understand it, those allocate userland VM.
>
>> But now I would like to write and read inside those pages still being
>> in kernel land.  When I tried with copyout to write buffer inside it
>> I got a page fault...
>
> I don't recall what process your code is creating userland memory for.

I would like to allocate memory remotely (using kernel land)
I did (with your help) the network kernel layer and now I would like to 
allocate large memory page inside a kernel process and read/write data.

> If it's not the current process - the one in curproc - or something
> suitably similar for a multiprocessor kernel, copyout won't work.
>
>> I learnt from der Mouse that at this step no backend physical pages
>> are created in relation to my virtual space, how do I have to force a
>> page creation?
>
> If the memory is for the current process, I _think_ copyout should do
> that.
>
> Of course, I could be wrong.

Unfortunately it is in the same kthread and copyout cause a page fault 
too in my test...

> It sounds to me as though what you really want is pageable kernel
> memory.  I don't know whether that exists at present.

Hehe here we are, This is what I would like to have.

Any idea how can I produce such a thing?

> /~\ The ASCII				der Mouse
> \ / Ribbon Campaign
>  X  Against HTML	       mouse@rodents.montreal.qc.ca
> / \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B
>