Subject: Re: uvm_map ?
To: None <tech-kern@netbsd.org>
From: Nalin Gupta <nalingupta2000@gmail.com>
List: tech-kern
Date: 04/12/2007 11:50:59
On 4/12/07, Matt Thomas <matt@3am-software.com> wrote:
> Nalin Gupta wrote:
> > hello
> >
> > Is uvm_map enough to attach kernel memory to user process ?
>
> No.  Perhaps if you could step back and describe what you are
> trying to achieve and let us guide you to the proper solution...
>

Hello All,

I need to implement Buffer Pool of chunks in kernel, which shall be
shared simultaneously with multiple user processes in kernel mode as
well as user mode, kernel threads and IRQ Context. This Buffer Pool
shall maintain freelist of chunks, which can be fast allocated or
deallocated.  Total Max Size shall around 10-20KB. (lets say upto 1
MB).

For multiple user processes in user mode, most important is to acheive
Zero Copy, while writing in to respective chunks.

Mostly it is Write Operation from anywhere.

Probably, later I would like to attach these chunks to "mbuf" too,
to upload them thru udp/tcp socket to some host.

My Appraoch:
I am assuming, I can allocate buffer in kernel, whose virtual address,
shall be enough to handle kernel mode, kernel thread and IRQ Context
requirements.

For user mode, for each interested user process, I shall attach this
complete Buffer Pool
to its virtual address space. In one way Complete Buffer is shared
with every one, but each stakeholder work on allocated chunk only.

In one of my earlier posting
http://mail-index.netbsd.org/tech-kern/2007/04/10/0001.html
I have put what I have done in my test program. If you more details
are needed, please let me know.

I appreciate your guidance and help.

regards,
- nalin