<div dir="ltr">Thanks for elaborating ,I've learned that it's not worth it,i'm turning other ways for performance consideration ,thanks!</div><div class="gmail_extra"><br><div class="gmail_quote">2018-07-13 15:33 GMT+08:00 <span dir="ltr"><<a href="mailto:valdis.kletnieks@vt.edu" target="_blank">valdis.kletnieks@vt.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, 13 Jul 2018 11:02:13 +0800, bing zhu said:<br>
<br>
> I‘m trying to write a simple fs in user space,if memcpy is slower than<br>
<span class="">> kernel , i think it's unfair,as for only cpu for my task,<br>
</span>> it's a bit of arbitrary ,i just want my task not interrupted during a<br>
<span class="">> specific time is that possible ?<br>
<br>
</span>Not getting interrupted is an *entirely* different issue than making memcpy fast.<br>
<br>
Note that in general, systems code should be able to deal with interruptions<br>
during most parts of the code, and locking used and disabling pre-emption for<br>
sections of code that can't deal with being interrupted. Remember that if your<br>
filesystem code turns off interrupts for long enough, you can start losing<br>
things like I/O completions. Fortunately for those who write systems code,<br>
the vast majority of interrupts are totally transparent to the vast majority<br>
of the kernel code.<br>
<br>
And if you're doing a file system in userspace, you're going to fail to notice<br>
hundreds or even thousands of interrupts happening. If you don't believe me,<br>
'cat /proc/interrupts', and realize that userspace didn't notice *any* of them<br>
happening.<br>
<br>
</blockquote></div><br></div>