lkml.org 
[lkml]   [2015]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/5] vhost: support upto 509 memory regions


On 19/06/2015 10:05, Michael S. Tsirkin wrote:
> > No, only destruction of the memory region frees it. address_space_map
> > takes a reference to the memory region and address_space_unmap releases it.
> >
> > Paolo
>
> Confused. So can we call mmap(MAP_NORESERVE) in address_space_unmap
> after we detect refcount is 0?

No, because in the meanwhile another DIMM could have been hotplugged
at the same place where the old one was. This is legal:

user guest QEMU
----------------------------------------------------------------------------------------
start I/O
'---------------> address_space_map
device_del
'-------------------> receives SCI
executes _EJ0
'---------------> memory_region_del_subregion
object_unparent
device_add
'-----------------------------------------> device_set_realized
hotplug_handler_plug
pc_machine_device_plug_cb
pc_dimm_plug
memory_region_add_subregion

I/O finishes
address_space_unmap

Surprise removal similarly could be done in QEMU, but it will hold to
some resources for as long as the device backends need them.

Paolo


\
 
 \ /
  Last update: 2015-06-19 11:21    [W:0.220 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site