Question about memcpy

Alex Arvelaez ealejandro at outlook.com
Sat Jul 7 09:21:20 EDT 2018


On Jul 7, 2018 7:37 AM, bing zhu <zhubohong12 at gmail.com> wrote:
>
> Dear Sir/Ma'am
> Thank you for your time ,i'm a student new to linux kernel.
> I have a question about memcpy,i noticed that memcpy is faster in kernel than in user space
> for example :
> in a module helloworld , i use memcpy to copy a 4096B to a block of memory for like 10000 times
> and in user space i do the same thing,I noticed that kernel is faster than user ,
> is it possible that in kernel when i insmod hello it can not be scheduled but in user space it will so kernel is faster?

This makes sense, less context switches.

> is there a possible way that a user task can run a block of code that uninterruptable? No switch ,no schedule ?

I don't think this is possible, Linux is a preemptive kernel.

> Thank you !
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180707/1a889d44/attachment.html>


More information about the Kernelnewbies mailing list