* Question about vmsplice + SPLICE_F_GIFT
@ 2019-07-23 20:33 Leonardo Bras
2019-07-23 20:36 ` Leonardo Bras
2019-07-26 8:52 ` Miklos Szeredi
0 siblings, 2 replies; 3+ messages in thread
From: Leonardo Bras @ 2019-07-23 20:33 UTC (permalink / raw)
To: linux-fsdevel, linux-kernel; +Cc: Alexander Viro
[-- Attachment #1: Type: text/plain, Size: 1096 bytes --]
Hello everybody,
I am not sure if this is the right place to be asking this. If is not,
I apologize for the inconvenience. Also, please tell me where is a
better way to as these questions.
I am trying to create a basic C code to test vmsplice + SPLICE_F_GIFT
for moving memory pages between two processes without copying.
I have followed the man pages and several recipes across the web, but I
could not reproduce it yet.
Basically, I am doing:
Sending process:
- malloc + memcpy for generating pages to transfer
- vmsplice with SPLICE_F_GIFT sending over named pipe (in a loop)
Receiving process:
- Create mmaped file to receive the pages
- splice with SPLICE_F_MOVE receiving from named pipe (in a loop)
I have seen the SPLICE_F_MOVE being used on steal ops from the
'pipebuffer', but I couldn't find a way to call it from splice.
Questions:
It does what I think it does? (reassign memory pages from a process to
another)
If so, does page gifting still works?
If so, is there a basic recipe to test it's workings?
Thank you for reading,
Leonardo Brás
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Question about vmsplice + SPLICE_F_GIFT
2019-07-23 20:33 Question about vmsplice + SPLICE_F_GIFT Leonardo Bras
@ 2019-07-23 20:36 ` Leonardo Bras
2019-07-26 8:52 ` Miklos Szeredi
1 sibling, 0 replies; 3+ messages in thread
From: Leonardo Bras @ 2019-07-23 20:36 UTC (permalink / raw)
To: linux-fsdevel, linux-kernel; +Cc: Alexander Viro
[-- Attachment #1: Type: text/plain, Size: 285 bytes --]
On Tue, 2019-07-23 at 17:33 -0300, Leonardo Bras wrote:
> I have seen the SPLICE_F_MOVE being used on steal ops from the
> 'pipebuffer', but I couldn't find a way to call it from splice.
Sorry, typo here. I meant:
> I have seen the SPLICE_F_GIFT being used on steal ops [...]
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Question about vmsplice + SPLICE_F_GIFT
2019-07-23 20:33 Question about vmsplice + SPLICE_F_GIFT Leonardo Bras
2019-07-23 20:36 ` Leonardo Bras
@ 2019-07-26 8:52 ` Miklos Szeredi
1 sibling, 0 replies; 3+ messages in thread
From: Miklos Szeredi @ 2019-07-26 8:52 UTC (permalink / raw)
To: Leonardo Bras; +Cc: linux-fsdevel, linux-kernel, Alexander Viro
On Tue, Jul 23, 2019 at 10:33 PM Leonardo Bras <leonardo@linux.ibm.com> wrote:
>
> Hello everybody,
>
> I am not sure if this is the right place to be asking this. If is not,
> I apologize for the inconvenience. Also, please tell me where is a
> better way to as these questions.
>
> I am trying to create a basic C code to test vmsplice + SPLICE_F_GIFT
> for moving memory pages between two processes without copying.
>
> I have followed the man pages and several recipes across the web, but I
> could not reproduce it yet.
>
> Basically, I am doing:
> Sending process:
> - malloc + memcpy for generating pages to transfer
> - vmsplice with SPLICE_F_GIFT sending over named pipe (in a loop)
> Receiving process:
> - Create mmaped file to receive the pages
> - splice with SPLICE_F_MOVE receiving from named pipe (in a loop)
As the splice(2) man page says SPLICE_F_MOVE is currently a no-op.
> I have seen the SPLICE_F_MOVE being used on steal ops from the
> 'pipebuffer', but I couldn't find a way to call it from splice.
>
> Questions:
> It does what I think it does? (reassign memory pages from a process to
> another)
> If so, does page gifting still works?
> If so, is there a basic recipe to test it's workings?
What is the end goal?
It is easy to transfer pages using shared memory (see shm_open(3) and
related API), so why mess with splice?
Thanks,
Miklos
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-07-26 8:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-23 20:33 Question about vmsplice + SPLICE_F_GIFT Leonardo Bras
2019-07-23 20:36 ` Leonardo Bras
2019-07-26 8:52 ` Miklos Szeredi
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).