zero-copy

Linux splice() returning EINVAL (“Invalid argument”)

随声附和 提交于 2019-12-05 12:29:14
I'm trying to experiment with using splice ( man 2 splice ) to copy data from a UDP socket directly to a file. Unfortunately the first call to splice() returns EINVAL. The man page states: EINVAL Target file system doesn't support splicing; target file is opened in append mode; neither of the descriptors refers to a pipe; or offset given for nonseekable device. However, I believe none of those conditions apply. I'm using Fedora 15 (kernel 2.6.40-4) so I believe splice() is supported on all filesystems. The target file should be irrelevant in the first call to splice, but for completeness I'm

FileChannel zero-copy transferTo fails to copy bytes to SocketChannel

落爺英雄遲暮 提交于 2019-12-05 10:33:56
I'm seeing some strange behavior when transferring large files from file to socket using zero-copy in Java. My environments: Windows 7 64-bit JDK 1.6.0_45 and 1.7.0_79. Centos 6.6 64-bit JDK 1.6.0_35 What the program does: client copies an input file into a socket, and server copies socket to output file using zero-copy methods: transferFrom and transferTo. Not all bytes are reaching the server if file size is relatively large, 100Mb+ in case of Windows and 2GB+ in case of Centos. Client and server reside on the same machine and localhost address is used to transfer data. The behavior is

Using Java to perform Zero Copy data transfers between two or more sockets

旧巷老猫 提交于 2019-12-04 18:05:58
问题 Does any one know of any good java libraries/API packages that performs zero copy data transfers between two or more sockets? I know that Java's NIO API can perform zero copy data transfers from disk to socket and vice versa using java.nio.channels.FileChannel.transferTo and java.nio.channels.FileChannel.transferFrom methods respectively. However, there doesn't appear to be support for java socket to socket zero copy transfers. In addition any java libraries/API that can perform the system

How do I store a result using Serde Zero-copy deserialization of a Futures-enabled Hyper Chunk?

丶灬走出姿态 提交于 2019-12-04 03:54:52
问题 I'm using futures, tokio, hyper, and serde_json to request and deserialize some data that I need to hold until my next request. My initial thought was to make a struct containing the hyper::Chunk and the deserialized data that borrows from the Chunk , but couldn't get the lifetimes right. I tried using the rental crate, but I can't get this to work either. Perhaps I'm using the 'buffer lifetime before declaring the buffer Vec , but maybe I've messed something else up: #[rental] pub struct

Cuda zero-copy performance

大憨熊 提交于 2019-12-02 06:52:17
问题 Does anyone have experience with analyzing the performance of CUDA applications utilizing the zero-copy (reference here: Default Pinned Memory Vs Zero-Copy Memory) memory model? I have a kernel that uses the zero-copy feature and with NVVP I see the following: Running the kernel on an average problem size I get instruction replay overhead of 0.7%, so nothing major. And all of this 0.7% is global memory replay overhead. When I really jack up the problem size, I get an instruction replay

Cuda zero-copy performance

狂风中的少年 提交于 2019-12-02 04:00:00
Does anyone have experience with analyzing the performance of CUDA applications utilizing the zero-copy (reference here: Default Pinned Memory Vs Zero-Copy Memory ) memory model? I have a kernel that uses the zero-copy feature and with NVVP I see the following: Running the kernel on an average problem size I get instruction replay overhead of 0.7%, so nothing major. And all of this 0.7% is global memory replay overhead. When I really jack up the problem size, I get an instruction replay overhead of 95.7%, all of which is due to global memory replay overhead. However, the global load efficiency

Which file systems support splicing via Linux's splice(2)?

廉价感情. 提交于 2019-11-30 17:16:15
The man page for the splice system call says that splice may fail and set errno to EINVAL if: Target file system doesn't support splicing; neither of the descriptors refers to a pipe; or offset given for non-seekable device Which file systems support splicing? My original answer was partially incorrect, this is a major rewrite. Linux 2.6.30.10 and below In Linux 2.6.30.10 and older, splice returns EINVAL when the source or target filesystem does not support splicing. Here are the filesystems that do support splicing : in read mode : adfs, affs, afs, bfs, btrfs, coda, ecryptfs, exofs, ext2,

Why no zero-copy networking in linux kernel? [closed]

一世执手 提交于 2019-11-30 08:57:28
I'd like to know the reasons for why the linux kernel (or any other mainstream OS) does not have a feature for zero copy networking ? By zero copy I mean, that an packet/datastream does not get copied for passing to an application in userspace but e.g. uses a memory-pool type of allocator to share the memory between kernel and userspace. I've came up with 3 theory's on my own: a) I guess there are security concerns. But is there really no way of making memory shared securily between userspace and kernel when they are just used as a buffer ? b) I guess there are stability concerns. But can't we

Which file systems support splicing via Linux's splice(2)?

时间秒杀一切 提交于 2019-11-30 01:21:49
问题 The man page for the splice system call says that splice may fail and set errno to EINVAL if: Target file system doesn't support splicing; neither of the descriptors refers to a pipe; or offset given for non-seekable device Which file systems support splicing? 回答1: My original answer was partially incorrect, this is a major rewrite. Linux 2.6.30.10 and below In Linux 2.6.30.10 and older, splice returns EINVAL when the source or target filesystem does not support splicing. Here are the

Why no zero-copy networking in linux kernel? [closed]

主宰稳场 提交于 2019-11-29 12:48:21
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . I'd like to know the reasons for why the linux kernel (or any other mainstream OS) does not have a feature for zero copy networking ? By zero copy I mean, that an packet/datastream does not get copied for passing to an application in userspace but e.g. uses a memory-pool type