What is the semantics of vmsplice (2), with and without a present?

I am trying to understand the functionality of syscall vmsplice(2) (man page here ). I have two questions about the effect of the SPLICE_F_GIFT flag:

  • The man page says that after you give the pages to the kernel, you should never change memory again. Does this mean that the memory is tied forever, or perhaps it refers to virtual memory, which can be disabled by the gift process, and not by physical memory? In other words, what is the typical use of this species?

  • If I do not set SPLICE_F_GIFT , is vmsplice(2) any value other than a vectorized syscall, e.g. writev(2) ?

+4
source share
1 answer

Does this mean that the memory is permanently attached, or perhaps refers to virtual memory, which can be disabled by the gift process, and not by physical memory? In other words, what is the typical use of this species?

You promise not to change the page. Not virtual page addressing. For most cases, a sentence operation looks something like this:

 mmap read vmsplice munmap 

Usually you want to use mmap on top of malloc , since you want to have a page, not just 4096 bytes of RAM. Which could sit in the middle of 2 MB or 1 GB of HUGE_PAGE , if your distributor determines that it is more efficient.

If I do not set SPLICE_F_GIFT, is it vmsplice(2) different from a sketch with a record like writev(2) ?

Yes

Most core buffers are pipes. Or are pipes really represented by the same data structure as buffers?

0
source

All Articles