On 07/11/2018 09:00 PM, David Hildenbrand wrote: > On 11.07.2018 17:07, frankja wrote: >> On Fri, 6 Jul 2018 16:52:50 +0200 >> David Hildenbrand <david@xxxxxxxxxx> wrote: >> >>> On 06.07.2018 15:55, Janosch Frank wrote: >>>> So, after the userfaultfd fix postcopy does work now, but vSIE in >>>> combination with paging can still result in crashing g3s. Therefore >>>> we split up the series and only integrate non-vSIE support for now. >>>> >>> >>> Just for the fun of it, did you try unlocking THP on a 4k guest with >>> the KVM huge page capability set? Should be fairly easy. >>> >>> My assumption is that it should be a pretty good sanity check if all >>> notifiers/invalidations are working :) >> >> After ripping out all of the safeguards, the guest boots and is >> successfully running memtester on 4g of its memory. >> >> The guest itself has 6gb: >> >> 3fdeff00000-3ff6ff00000 rw-p 00000000 00:00 0 >> Size: 6291456 kB >> KernelPageSize: 4 kB >> MMUPageSize: 4 kB >> Rss: 6291456 kB >> Pss: 6291456 kB >> Shared_Clean: 0 kB >> Shared_Dirty: 0 kB >> Private_Clean: 0 kB >> Private_Dirty: 6291456 kB >> Referenced: 6291456 kB >> Anonymous: 6291456 kB >> LazyFree: 0 kB >> AnonHugePages: 6266880 kB >> ShmemPmdMapped: 0 kB >> Shared_Hugetlb: 0 kB >> Private_Hugetlb: 0 kB >> Swap: 0 kB >> SwapPss: 0 kB >> Locked: 6291456 kB >> VmFlags: rd wr mr mw me dc ac dd hg mg >> > > Well that looks promising. Does it make sense to add that "unlocking" as > an addon patch right away? No, please no THP automatically as it is not always a win for KVM especially on older CPUs. We have now a minimum set of patches - lets keep it that way. For THP we need some more time and logic (e.g. only do it when MACHINE_HAS_TLB_GUEST is avalable as newer cpus do always benefit). > > So if > - KVM module is loaded with the right module parameter > - QEMU does not enable CMMA and sets the HPAGE KVM capability > > Transparent huge pages would be used. > > It could be in QEMU as simple as "if CMM CPU feature is not enabled, > HPAGE capability will be set if available". So "-cpu host" will behave > as before. "-cpu host,cmm=off" would result in THP being used (if KVM > supports HPAGE capability). Migration should work out of the box. > > Opinions?