<div dir="ltr">Hi everyone,<div><span style="background-color:rgb(255,255,255)"><br></span></div><div style><span style="background-color:rgb(255,255,255)">My name is Larisa Grigore and this summer I will be developing Userland System V IPC (shared memory, semaphores and message queues). This project aims to implement System V IPC mechanism in user-space in order to achive good performance for heavy consumers. </span></div>
<div style><span style="background-color:rgb(255,255,255)"><br></span></div><div style><span style="background-color:rgb(255,255,255)">All operations as creation/destruction will be implemented through messages sent to a daemon that will take care of the management of System V IPC resources, things that were normally done in kernel. For communicating with the daemon, a process must register to it using a known named pipe. After that, both client process and daemon will use a separate channel for communication.</span></div>
<div style><span style="background-color:rgb(255,255,255)"><br></span></div><div style><span style="background-color:rgb(255,255,255)">Security is ensure with kernel help. I think that Linux implementation for SysV shared memory is a good starting point. <span style="color:rgb(0,0,0);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.1875px">When </span><em style="margin:0px;padding:0px;border:0px;outline:0px;vertical-align:baseline;color:rgb(0,0,0);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.1875px">shmget()</em><span style="margin:0px;padding:0px;border:0px;outline:0px;vertical-align:baseline;color:rgb(0,0,0);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.1875px">[1]</span><span style="color:rgb(0,0,0);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.1875px"> is called a file is allocated</span><span style="color:rgb(0,0,0);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.1875px"> assigning it some operations (in our case, </span><em style="margin:0px;padding:0px;border:0px;outline:0px;vertical-align:baseline;color:rgb(0,0,0);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.1875px">open</em><span style="color:rgb(0,0,0);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.1875px">,</span><em style="margin:0px;padding:0px;border:0px;outline:0px;vertical-align:baseline;color:rgb(0,0,0);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.1875px"> mmap</em><span style="color:rgb(0,0,0);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.1875px"> and </span><em style="margin:0px;padding:0px;border:0px;outline:0px;vertical-align:baseline;color:rgb(0,0,0);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.1875px">close</em><span style="color:rgb(0,0,0);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.1875px"> is enough). The easiest way to privide that functionality is using a driver. </span></span></div>
<div style><span style="color:rgb(0,0,0);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.1875px;background-color:rgb(255,255,255)"><br></span></div><div style><span style="background-color:rgb(255,255,255)"><span style="color:rgb(0,0,0);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.1875px">For shared memory, files will be created in order to be mapped in the process address space. Semaphores can be implemented similar to Posix Unnamed semaphores (memory-based semaphores)[2]. </span><span style="color:rgb(0,0,0);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.1875px">In message queues case, if it is time, client will map a file in its address space. The file will contain, beside messages written by processes, some control information.</span><span style="color:rgb(0,0,0);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.1875px"><br>
</span></span></div><div style><span style="color:rgb(0,0,0);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.1875px;background-color:rgb(255,255,255)"><br></span></div><div style><span style="background-color:rgb(255,255,255)"><span style="color:rgb(0,0,0);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.1875px">During development phase, I will implement some simple tests but also use some simple testsuites already available. Finally, I will use stress testsuites, benchmarks and see what is the performance of a heavy consumer like PostgreSQL. This results will be compared to the existing kernel implementation. The last step is to identify solutions such that the userland </span><span style="color:rgb(0,0,0);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.5px">implementation performs on par with or better than the kernel implementation.</span></span></div>
<div style><span style="color:rgb(0,0,0);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.5px;background-color:rgb(255,255,255)"><br></span></div><div style><span style="color:rgb(0,0,0);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.5px;background-color:rgb(255,255,255)">More details can be found in my proposal[3].</span></div>
<div style><span style="color:rgb(0,0,0);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.5px;background-color:rgb(255,255,255)"><br></span></div><div style><span style="background-color:rgb(255,255,255)"><span style="color:rgb(0,0,0);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.5px">[1] </span><span style="color:rgb(0,0,0);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.1875px"><a href="http://lxr.linux.no/linux+v3.9/mm/shmem.c#L2898">http://lxr.linux.no/linux+v3.9/mm/shmem.c#L2898</a></span></span></div>
<div style><span style="background-color:rgb(255,255,255)"><span style="color:rgb(0,0,0);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.1875px">[2] </span><span style="color:rgb(0,0,0);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.1875px"><a href="http://linux.die.net/man/7/sem_overview">http://linux.die.net/man/7/sem_overview</a></span></span></div>
<div style><span style="background-color:rgb(255,255,255)"><span style="color:rgb(0,0,0);font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;line-height:19.5px">[3] </span><a href="http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/larisagrigore/12001">http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/larisagrigore/12001</a></span></div>
<div style><span style="background-color:rgb(255,255,255)"><br></span></div><div style><br></div><div style>Thanks,<br></div><div style><span style="background-color:rgb(255,255,255)">Larisa Grigore</span></div></div>