Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 May 2013 11:51:56 +0200
From:      Luigi Rizzo <rizzo@iet.unipi.it>
To:        Zaphod Beeblebrox <zbeeble@gmail.com>
Cc:        FreeBSD Current <current@freebsd.org>
Subject:   Re: copyin+copyout in one step ?
Message-ID:  <CA%2BhQ2%2Bhk-en_D3O5mrju0V4Zuw1SWcRmQC2O8UFLP_dF%2B3YE5Q@mail.gmail.com>
In-Reply-To: <CACpH0Mf57zA0LqEykuYdj1KQyqA%2BqUyTYrxJCsiWdLYPRBU-PA@mail.gmail.com>
References:  <20130527233801.GA32042@onelab2.iet.unipi.it> <CACpH0Mf57zA0LqEykuYdj1KQyqA%2BqUyTYrxJCsiWdLYPRBU-PA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, May 28, 2013 at 6:56 AM, Zaphod Beeblebrox <zbeeble@gmail.com>wrote:

> On Mon, May 27, 2013 at 7:38 PM, Luigi Rizzo <rizzo@iet.unipi.it> wrote:
>
>>
>> say a process P1 wants to use the kernel to copy the content of a
>> buffer SRC (in its user address space) to a buffer DST (in the
>> address space of another process P2), and assume that P1 issues the
>> request to the kernel when P2 has already told the kernel where the
>> data should go:
>>
>
> Urm... Isn't the use of shared memory the more obvious way to transfer
> data between processes?  Am I missing some nuance?
>

see my other message about the use between VMs.

I cannot simply share memory because otherwise 

the sender could
alter the message while the receiver is playing with it,
so at least one copy is needed (or page flipping, but that
would be way more complex/wasteful/
expensive)

.

But also, in my case the source and destination buffers
are chosen arbitrarily by the two VMs, and do not necessarily
reside in the mmapped buffers that the kernel module provides.
So at the moment I have three copies instead of one.

cheers
luigi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2BhQ2%2Bhk-en_D3O5mrju0V4Zuw1SWcRmQC2O8UFLP_dF%2B3YE5Q>