I am doing a project related to thread scheduling. This project needs communication between kernel and user-level applications. Basically, the user-level application sets or unset a bit in a bit vector, according to the application's status (this part is not related to this question, so I skip it). Then the kernel reads the bit vector everytime it schedules a thread. 
<div><br class="webkit-block-placeholder"></div><div>My question is where to allocate the bit vector.<div><br class="webkit-block-placeholder"></div><div>1. If I allocate the bit vector in user-level, then everytime the kernel wants to read the bit vector, I has to do a copy_from_user(). I tried this solution, this incurs a lot of overhead and also crash the os. Since the copy_from_user() needs to look up the virtual address which corresponds to the starting address of bit-vector, it will cause paging in the middle of scheduling. Is there any other way that the kernel can directly access user-level space without doing copying and address translation?
</div><div><br class="webkit-block-placeholder"></div><div>2. If I allocate the bit vector directly in the kernel space. How can I do this? Is it possible to create an extra system call that allows user-level program to allocate a kernel buffer?
<br clear="all"><br></div><div>Could anyone help me out on this? Thanks!</div><div><br>-- <br>Addr: 1025N, 23rd str, APT 33,<br> &nbsp; &nbsp; &nbsp; &nbsp; Lincoln, NE, 68503<br>Phone: (402)310-9826<br>WWW: <a href="http://cse.unl.edu/~fxian">
cse.unl.edu/~fxian</a>
</div></div>