Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1168637

Re: [PATCH 3/5] vhost: support upto 509 memory regions

From Paolo Bonzini <pbonzini@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 3/5] vhost: support upto 509 memory regions
Date 2015-06-19 11:00 +0200
Message-ID <pD0jw-2sP-3@gated-at.bofh.it> (permalink)
References (6 earlier) <pCJiG-30U-17@gated-at.bofh.it> <pCKy6-4Yo-5@gated-at.bofh.it> <pCZnr-17v-3@gated-at.bofh.it> <pCZnr-17v-5@gated-at.bofh.it> <pCZx8-1y4-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH 3/5] vhost: support upto 509 memory regions "Michael S. Tsirkin" <mst@redhat.com> - 2015-06-19 10:00 +0200
  Re: [PATCH 3/5] vhost: support upto 509 memory regions Paolo Bonzini <pbonzini@redhat.com> - 2015-06-19 10:00 +0200
    Re: [PATCH 3/5] vhost: support upto 509 memory regions "Michael S. Tsirkin" <mst@redhat.com> - 2015-06-19 10:10 +0200
      Re: [PATCH 3/5] vhost: support upto 509 memory regions Paolo Bonzini <pbonzini@redhat.com> - 2015-06-19 11:00 +0200
        Re: [PATCH 3/5] vhost: support upto 509 memory regions "Michael S. Tsirkin" <mst@redhat.com> - 2015-06-19 15:40 +0200

csiph-web