qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
Cc: guz.fnst@cn.fujitsu.com, pbonzini@redhat.com,
	tangchen@cn.fujitsu.com, qemu-devel@nongnu.org,
	izumi.taku@jp.fujitsu.com
Subject: Re: [Qemu-devel] [PATCH v5 1/7] docs: update documentation for memory hot unplug
Date: Mon, 30 Mar 2015 17:47:45 +0200	[thread overview]
Message-ID: <20150330174745.38d9ee5d@nial.brq.redhat.com> (raw)
In-Reply-To: <a6ea83cc6ff226e759b46bf6a4f9aa014d91546c.1427425363.git.zhugh.fnst@cn.fujitsu.com>

On Fri, 27 Mar 2015 17:20:34 +0800
Zhu Guihua <zhugh.fnst@cn.fujitsu.com> wrote:

> Add specification about how to use memory hot unplug, and add
> a flow diagram to explain memory hot unplug process.
> 
> Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
> ---
>  docs/memory-hotplug.txt         | 24 ++++++++++++++++++++----
>  docs/specs/acpi_mem_hotplug.txt | 16 +++++++++++++++-
>  2 files changed, 35 insertions(+), 5 deletions(-)
> 
> diff --git a/docs/memory-hotplug.txt b/docs/memory-hotplug.txt
> index f70571d..0de7f1b 100644
> --- a/docs/memory-hotplug.txt
> +++ b/docs/memory-hotplug.txt
> @@ -1,12 +1,10 @@
>  QEMU memory hotplug
>  ===================
>  
> -This document explains how to use the memory hotplug feature in QEMU,
> +This part explains how to use the memory hotplug feature in QEMU,
>  which is present since v2.1.0.
not related change? It's better to leave as it was.

>  
> -Please, note that memory hotunplug is not supported yet. This means
> -that you're able to add memory, but you're not able to remove it.
> -Also, proper guest support is required for memory hotplug to work.
> +And, proper guest support is required for memory hotplug to work.
reword it like:
Guest support is required for memory hotplug to work.

>  
>  Basic RAM hotplug
>  -----------------
> @@ -74,3 +72,21 @@ comes from regular RAM, 1GB is a 1GB hugepage page and 256MB is from
>     -device pc-dimm,id=dimm1,memdev=mem1 \
>     -object memory-backend-file,id=mem2,size=256M,mem-path=/mnt/hugepages-2MB \
>     -device pc-dimm,id=dimm2,memdev=mem2
> +
> +
> +QEMU memory hot unplug
> +======================
s/^^^/
RAM hot-unplug
--------------
/

> +This part explains how to use the memory hot unplug feature in QEMU.
unnecessary, drop it.

> +
> +In order to be able to hot unplug pc-dimm device, QEMU has to be told the id
> +of pc-dimm device. The id was assigned when you hot plugged memory.
> +
> +One monitor command is used to hot unplug memory:
s/One/Two/

Haven't you forgotten about object_del ???
In typical use-case backend will be deleted as well

> +
> + - "device_del": deletes a front-end pc-dimm device
> +
> +For example, assuming that the pc-dimm device with id "dimm1"   
> +into the guest, the following command deletes the pc-dimm device from the
> +guest.
s/was hotplugged into the guest/exists/
s/deletes the pc-dimm device from the guest/tries to remove it/

> +
> +  (qemu) device_del dimm1
remove associated backend as well

> diff --git a/docs/specs/acpi_mem_hotplug.txt b/docs/specs/acpi_mem_hotplug.txt
> index 1290994..a88b286 100644
> --- a/docs/specs/acpi_mem_hotplug.txt
> +++ b/docs/specs/acpi_mem_hotplug.txt
> @@ -2,7 +2,7 @@ QEMU<->ACPI BIOS memory hotplug interface
>  --------------------------------------
>  
>  ACPI BIOS GPE.3 handler is dedicated for notifying OS about memory hot-add
> -events.
> +and hot-remove events.
>  
>  Memory hot-plug interface (IO port 0xa00-0xa17, 1-4 byte access):
>  ---------------------------------------------------------------
> @@ -42,3 +42,17 @@ Selecting memory device slot beyond present range has no effect on platform:
>       ignored
>     - read accesses to memory hot-plug registers not documented above return
>       all bits set to 1.
> +
> +Memory hot remove process diagram:
> +----------------------------------


> +Memory hot unplug is rather complicated multi-stage process, it is asynchronous
> +procedures. The follwoing diagram describes memory hot unplug process.
drop ^^^ hunk


> +
> +             QEMU             |             Guest OS
> +-------------------------------------------------------------------------------
> +     unplug request cb ->     |
> +                              |  OSPM processes ejection request
> +                              |  <- OSPM clears device remove event
> +    clear remove event ->     |
> +                              |  <- OSPM issues _EJ0 and initiates device eject
> +  unplug cb (eject device)    |
perhaps something like below would be better

 +-------------+     +-----------------------+      +------------------+     
 |  1. QEMU    |     | 2. QEMU               |      |3. QEMU           |     
 |  device_del +---->+ device unplug request +----->+Send SCI to guest,|     
 |             |     |         cb            |      |return control to |     
 +-------------+     +-----------------------+      |management        |     
                                                    +------------------+     
                                                                             
 +---------------------------------------------------------------------+     
                                                                             
 +---------------------+              +-------------------------+            
 | OSPM:               | remove event | OSPM:                   |            
 | send Eject Request, |              | Scan memory devices     |            
 | clear remove event  +<-------------+ for event flags         |            
 |                     |              |                         |            
 +---------------------+              +-------------------------+            
           |                                                                 
           |                                                                 
 +---------v--------+            +-----------------------+                   
 | Guest OS:        |  success   | OSPM:                 |                   
 | process Ejection +----------->+ Execute _EJ00 method, |                   
 | request          |            | set eject bit in flags|                   
 +------------------+            +-----------------------+                   
           |failure                         |                                
           v                                v                                
 +------------------------+      +-----------------------+                   
 | OSPM:                  |      | QEMU:                 |                   
 | set OST event & status |      | call device unplug cb |                   
 | fields                 |      |                       |                   
 +------------------------+      +-----------------------+                   
          |                                  |                               
          v                                  v                               
 +------------------+              +-------------------+                     
 |QEMU:             |              |QEMU:              |                     
 |Send OST QMP event|              |Send device deleted|                     
 |                  |              |QMP event          |                     
 +------------------+              |                   |                     
                                   +-------------------+                     
                                                                             
                                                                             

  reply	other threads:[~2015-03-30 15:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-27  9:20 [Qemu-devel] [PATCH v5 0/7] QEMU memory hot unplug support Zhu Guihua
2015-03-27  9:20 ` [Qemu-devel] [PATCH v5 1/7] docs: update documentation for memory hot unplug Zhu Guihua
2015-03-30 15:47   ` Igor Mammedov [this message]
2015-03-27  9:20 ` [Qemu-devel] [PATCH v5 2/7] acpi, mem-hotplug: add acpi_memory_slot_status() to get MemStatus Zhu Guihua
2015-03-27  9:20 ` [Qemu-devel] [PATCH v5 3/7] acpi, mem-hotplug: add unplug request cb for memory device Zhu Guihua
2015-04-01  8:23   ` Igor Mammedov
2015-03-27  9:20 ` [Qemu-devel] [PATCH v5 4/7] acpi, mem-hotplug: add unplug " Zhu Guihua
2015-03-27  9:20 ` [Qemu-devel] [PATCH v5 5/7] acpi: extend aml_field() to support UpdateRule Zhu Guihua
2015-04-01  8:39   ` Igor Mammedov
2015-03-27  9:20 ` [Qemu-devel] [PATCH v5 6/7] acpi: add hardware implementation for memory hot unplug Zhu Guihua
2015-03-30  9:09   ` Igor Mammedov
2015-03-27  9:20 ` [Qemu-devel] [PATCH v5 7/7] qmp-event: add event notification for memory hot unplug error Zhu Guihua
2015-03-27 14:53   ` Eric Blake
2015-03-30  3:07     ` Zhu Guihua
2015-03-30  2:53 ` [Qemu-devel] [PATCH v5 0/7] QEMU memory hot unplug support Zhu Guihua
2015-03-30  7:49   ` Paolo Bonzini
2015-04-01  8:42 ` Igor Mammedov
2015-04-01  9:43   ` Zhu Guihua

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150330174745.38d9ee5d@nial.brq.redhat.com \
    --to=imammedo@redhat.com \
    --cc=guz.fnst@cn.fujitsu.com \
    --cc=izumi.taku@jp.fujitsu.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=tangchen@cn.fujitsu.com \
    --cc=zhugh.fnst@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).