Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Feb 2011 11:12:59 +0800
From:      "beezarliu" <beezarliu@yahoo.com.cn>
To:        "John Baldwin" <jhb@freebsd.org>, "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: Re: map share memory to kernel space
Message-ID:  <201102151112522035530@yahoo.com.cn>
References:  <201102141718415933573@yahoo.com.cn>, <201102140939.17486.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2011-02-14 22:56:28, John Baldwin wrote:
>On Monday, February 14, 2011 4:18:50 am beezarliu wrote:
>> Hackers,
>> 
>> I want to access a userland share memory in a kernel thread. 
>> So I tried to map the share memory to the kernel space. 
>> The basic idea is to map the shm_object into kernel_map
>> when the share memory is created.
>> 
>> Using the following patch, I found the vm_object in kernel_map,
>> and the vm_object in the address space of userland process are the same.
>> But their content in the kernel and userland address mapped are different.
>> 
>> It's very strang since they are exactly the same vm_object.
>> Do I miss something, please help.
>
>Hmm, this is a bit of code I use for something similar to map a VM object into 
>the kernel.  It does not use vm_page_grab() directly though:


Initially, I wanted to allocate all the pages needed when the share memory is created,
in order to reduce page fault at the time it's used.
This seems to be an extra step.  :(

John, thank you very much!

Beezar


__________________________________________________
¸Ï¿ì×¢²áÑÅ»¢³¬´óÈÝÁ¿Ãâ·ÑÓÊÏä?
http://cn.mail.yahoo.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102151112522035530>