kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Question about memcpy
@ 2018-07-07 11:36 bing zhu
  2018-07-07 18:44 ` valdis.kletnieks at vt.edu
  0 siblings, 1 reply; 22+ messages in thread
From: bing zhu @ 2018-07-07 11:36 UTC (permalink / raw)
  To: kernelnewbies

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?
is there a possible way that a user task can run a block of code that
uninterruptable? No switch ,no schedule ?
Thank you !
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180707/2f8c8e06/attachment-0001.html>

^ permalink raw reply	[flat|nested] 22+ messages in thread
* Question about memcpy
@ 2018-07-07 13:21 Alex Arvelaez
  0 siblings, 0 replies; 22+ messages in thread
From: Alex Arvelaez @ 2018-07-07 13:21 UTC (permalink / raw)
  To: kernelnewbies

On Jul 7, 2018 7:37 AM, bing zhu <zhubohong12@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>

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2018-07-17  2:44 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-07 11:36 Question about memcpy bing zhu
2018-07-07 18:44 ` valdis.kletnieks at vt.edu
2018-07-08 14:03   ` bing zhu
2018-07-09  7:54     ` 袁建鹏
2018-07-09  8:14       ` bing zhu
2018-07-09 14:04     ` Himanshu Jha
2018-07-09 16:16       ` valdis.kletnieks at vt.edu
2018-07-14 10:10         ` Himanshu Jha
2018-07-10  4:50       ` bing zhu
2018-07-10  6:22         ` Greg KH
2018-07-10 14:51           ` bing zhu
2018-07-10 14:57             ` Greg KH
2018-07-10 16:03             ` valdis.kletnieks at vt.edu
2018-07-12  4:47               ` bing zhu
2018-07-12  5:34                 ` Greg KH
2018-07-12 14:27                   ` bing zhu
2018-07-12 14:53                     ` Greg KH
2018-07-13  3:02                       ` bing zhu
2018-07-13  7:33                         ` valdis.kletnieks at vt.edu
2018-07-17  2:44                           ` bing zhu
2018-07-12 16:49                     ` valdis.kletnieks at vt.edu
  -- strict thread matches above, loose matches on Subject: below --
2018-07-07 13:21 Alex Arvelaez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).