All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Dou Liyang <douly.fnst@cn.fujitsu.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
	Thomas Huth <thuth@redhat.com>, Andrew Jones <drjones@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	David Gibson <david@gibson.dropbear.id.au>,
	Michal Hocko <mhocko@kernel.org>
Subject: Re: [Qemu-devel] Memory Hotplug : Does QEmu support cold-plugged memory?
Date: Mon, 5 Jun 2017 10:45:08 +0200	[thread overview]
Message-ID: <20170605104508.1419d7af@nial.brq.redhat.com> (raw)
In-Reply-To: <1ee3ccf0-2d91-86ec-628c-d50ae3ffbe22@cn.fujitsu.com>

On Mon, 5 Jun 2017 15:53:02 +0800
Dou Liyang <douly.fnst@cn.fujitsu.com> wrote:

> Hi all,
> 
> I want to boot up a system with some removable memory.
> 
> So, i used '-object' and '-device' to cold-plug memory
> in QEmu as following :
> 
> ./x86_64-softmmu/qemu-system-x86_64 \
> 	...
> 	-object memory-backend-ram,id=mem3,size=128M \
> 	-device pc-dimm,id=dimm3,memdev=mem3 \
> 	...
> 
> then i want to hot-remove this memory by 'device-del' and
> 'object-del'.
> 
> But, unfortunately, I can't remove the memory device.
> 
> And, in guest OS, I found the memory's removable feature is 0,
> But, in QEmu monitor with 'info memory-devices', I found the
> hotplugged is false and hotpluggable is true.
It's issue in the guest side kernel.
In short it's not guarantied that guest kernel would be able
to hotremove DIMM module (even if hardware is capable of) since
kernel might use its memory as not MOVABLE, so DIMM might be
temporally or permanently pinned by kernel allocations.

There is ongoing refactoring/cleanup work upstream, that
tries to make memhotplug behavior consistent/reasonable.

If you are interested, I'd suggest to review/test changes that
Michal works on upstream, to make sure that refactoring won't
break your usecase.

You can find the latest series Michal posted at:
http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1410289.html


> 
> Could you help me:
> 
> 1, Can the ram based memory-backend be plugged like above?
yes, it can be used as above
 
> 2, Does the 'info memory-devices' command show a wrong info?
nope,
command shows hotpluggable status the way hw (qemu) sees it

> 3, Can file memory backend(memory-backend-file) be cold-plugged?
yes, it can.

[...]

  reply	other threads:[~2017-06-05  8:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-05  7:53 [Qemu-devel] Memory Hotplug : Does QEmu support cold-plugged memory? Dou Liyang
2017-06-05  8:45 ` Igor Mammedov [this message]
2017-06-05  8:54   ` Michal Hocko
2017-06-05  9:50   ` Dou Liyang

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=20170605104508.1419d7af@nial.brq.redhat.com \
    --to=imammedo@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=douly.fnst@cn.fujitsu.com \
    --cc=drjones@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=mhocko@kernel.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.