From: "Radim Krčmář" <rkrcmar@redhat.com>
To: "Cao, Lei" <Lei.Cao@stratus.com>
Cc: "Huang, Kai" <kai.huang@linux.intel.com>,
Paolo Bonzini <pbonzini@redhat.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH 3/6] KVM: Dirty memory tracking for performant checkpointing and improved live migration
Date: Fri, 29 Apr 2016 20:19:12 +0200 [thread overview]
Message-ID: <20160429181911.GA2687@potion> (raw)
In-Reply-To: <BL2PR08MB4818EC8F767DEB112204FE4F0650@BL2PR08MB481.namprd08.prod.outlook.com>
2016-04-28 19:58+0000, Cao, Lei:
> On 4/28/2016 5:13 AM, Huang, Kai wrote:
>> One general comment: won't it be better if you devide kvm_mt and make it
>> embedded to kvm_memory_slot? In my understanding the main difference
>> between bitmap and your log-dirty mechanism is you are using list not
>> bitmap, and I think make the dirty_gfn_list embedded to kvm_memory_slot
>> should simplify lots of your code.
>
> It's true that one difference of the new mechanism is the use of list
> instead of bitmap. Another difference is that the dirty list is per
> vcpu, instead of per memory slot. This is so that the list can be updated
> without holding a lock.
A writeup of alternatives behind your decision would be welcome.
Per-vcpu structures seems crucial with higher amount of VCPUs and
putting per-vcpu into kvm_memory_slots would either take much more
memory, or wouldn't scale as well.
Separating from kvm_memory_slot has its share of issues too, though,
because slot id can stand for different slots during runtime.
(Most/all can be solved by forbidding uses that lead to them, so
userspace would be to blame if memory tracking worked incorrectly.
E.g. reconfiguring a slot without pausing vcpus and draining dirty
pages.)
> It should be noted that what is saved on the dirty list is
> (mem slot id|offset), not gfn.
Current compaction causes a problem. Slot id is u32, but gnflist stores
only bottom 16 bits while upper 16 contain important address space.
And 48 bit offset isn't enough for GPA sizes above 60 bits.
Compaction can reserve up to PAGE_SHIFT bits. KVM must BUILD_BUG_ON()
if KVM_ADDRESS_SPACE_NUM and KVM_MEM_SLOTS_NUM don't fit. (We'll be
this reworking compaction as soon as per-vcpu address spaces arrive,
because KVM_MEM_SLOTS_NUM already takes 9 bits.)
next prev parent reply other threads:[~2016-04-29 18:19 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <201604261855.u3QItn85024244@dev1.sn.stratus.com>
2016-04-26 19:24 ` [PATCH 3/6] KVM: Dirty memory tracking for performant checkpointing and improved live migration Cao, Lei
2016-04-28 9:13 ` Huang, Kai
2016-04-28 19:58 ` Cao, Lei
2016-04-29 18:19 ` Radim Krčmář [this message]
2016-05-02 15:24 ` Cao, Lei
2016-05-02 15:46 ` Radim Krčmář
2016-05-02 15:51 ` Cao, Lei
2016-05-03 6:06 ` Huang, Kai
2016-05-03 14:11 ` Radim Krčmář
2016-05-04 7:45 ` Huang, Kai
2016-05-04 13:13 ` Radim Krčmář
2016-05-04 13:51 ` Cao, Lei
2016-05-04 17:15 ` Cao, Lei
2016-05-04 18:33 ` Cao, Lei
2016-05-04 18:57 ` Radim Krčmář
2016-05-06 9:46 ` Kai Huang
2016-05-06 12:09 ` Radim Krčmář
2016-05-06 15:13 ` Cao, Lei
2016-05-06 16:04 ` Radim Krčmář
2016-05-24 17:19 ` Cao, Lei
2016-06-30 13:49 ` Cao, Lei
2016-05-07 1:48 ` Kai Huang
2016-05-04 19:27 ` Radim Krčmář
2016-05-05 16:26 ` Radim Krčmář
2016-05-06 15:19 ` Cao, Lei
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=20160429181911.GA2687@potion \
--to=rkrcmar@redhat.com \
--cc=Lei.Cao@stratus.com \
--cc=kai.huang@linux.intel.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox