On 9/30/2017 4:18 PM, Yuanhan Liu wrote:
On Thu, Sep 28, 2017 at 08:09:38AM +0000, Tan, Jianfeng wrote:
Actually, the key (and typical) issue of multi-process here is the fds are
process specific, while they are stored in the shared memory. That means
only one will take effect eventually. Worse, the old ones are lost.
So, I think to make it right in this case, you should move the fds from
the shared memory and store them in the memory of the corresponding
process.
If that's done, all processes could have its own valid fds, then every
process could do the kick (if that's really necessary).
You could check following commit for more info.
553f45932fb7 ("net/virtio: store PCI operators pointer locally")
Have referred to the above solution, but seems not feasible for this case since
there are too many queues. For example, if we define an array like this:
int vhost_callfds[index_by_vid][index_by_queue_id];
The size would be MAX_VHOST_DEVICE * VHOST_MAX_VRING * 8Byte = 2Mbyte.
I think you can do it in a dynamic way, like what we did for vhost_dev
allocation?
I'll give it a try, thanks!
Thanks,
Jianfeng
--yliu
Instead, can we propose something like process_id to index array located at
shared memory?
Thanks,
Jianfeng