<p><br>
On Oct 28, 2012 11:49 AM, "Sengottuvelan S" <<a href="mailto:sengottuvelan.s@gmail.com">sengottuvelan.s@gmail.com</a>> wrote:<br>
><br>
><br>
> Hi Mulyadi<br>
> <br>
> I am able to do mmap and access virual-memory address and pages for a single process from user-space and working fine. I am not sure how to do it for multiple processes for shared resources using mmap. I better explain in detail here what I am experimenting it.<br>
> <br>
> for example:<br>
> <br>
> Kernel allocates kmalloc or vmalloc of 100 pages and set those pages as reserved. Kernel uses these pages to send/receive data to Process A or B depends on a condition.<br>
> <br>
> Process A and B do mmap those region to get/set data on those virtual-addresses/pages because I want faster access from userpace to kernel.<br>
> <br>
> Anyone knows if this will work with mmap?. Please let me know if anyother way to do it.<br>
> <br>
Not sure about your actual requiremnent, but there are other better way of sharing data between processes already exist. E.g. Shared memory.<br>
Advisable to use them instead of writing a new one</p>
<p>> On Sat, Oct 27, 2012 at 10:57 PM, Mulyadi Santosa <<a href="mailto:mulyadi.santosa@gmail.com">mulyadi.santosa@gmail.com</a>> wrote:<br>
>><br>
>> Hi...<br>
>><br>
>> On Thu, Oct 18, 2012 at 3:02 AM, Sengottuvelan S<br>
>> <<a href="mailto:sengottuvelan.s@gmail.com">sengottuvelan.s@gmail.com</a>> wrote:<br>
>> > For example,<br>
>> ><br>
>> > I have 2 different user space process A,B etc. I have to allocate memory in<br>
>> > Kernel for each of those processes (for example 2 pages) . Each process is<br>
>> > allowed to use only 1 page using mmap from user space.<br>
>> ><br>
>> > Is it possible to do with mmap?.<br>
>><br>
>> Not sure, but I guess better to do it directly with page_alloc...or at<br>
>> least kmalloc() to better utilize slab.<br>
>><br>
>> The thing that I think is hard to do, is to implement protection<br>
>> scheme to make sure say process A won't access page allocated by<br>
>> process B.<br>
>><br>
>> Hopefully I understand your goal correctly.<br>
>><br>
>><br>
>> --<br>
>> regards,<br>
>><br>
>> Mulyadi Santosa<br>
>> Freelance Linux trainer and consultant<br>
>><br>
>> blog: <a href="http://the-hydra.blogspot.com">the-hydra.blogspot.com</a><br>
>> training: <a href="http://mulyaditraining.blogspot.com">mulyaditraining.blogspot.com</a><br>
><br>
><br>
><br>
><br>
> -- <br>
> Regards,<br>
> S. Sengottuvelan.<br>
><br>
> _______________________________________________<br>
> Kernelnewbies mailing list<br>
> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
><br>
</p>