Re: [PATCH v13 17/35] KVM: Add transparent hugepage support for dedicated guest memory

2023-11-29 Thread Sean Christopherson
On Mon, Nov 27, 2023, Vlastimil Babka wrote: > On 11/2/23 16:46, Paolo Bonzini wrote: > > On Thu, Nov 2, 2023 at 4:38 PM Sean Christopherson > > wrote: > >> Actually, looking that this again, there's not actually a hard dependency > >> on THP. > >> A THP-enabled kernel _probably_ gives a higher

Re: [PATCH v13 17/35] KVM: Add transparent hugepage support for dedicated guest memory

2023-11-27 Thread Vlastimil Babka
On 11/2/23 16:46, Paolo Bonzini wrote: > On Thu, Nov 2, 2023 at 4:38 PM Sean Christopherson wrote: >> Actually, looking that this again, there's not actually a hard dependency on >> THP. >> A THP-enabled kernel _probably_ gives a higher probability of using >> hugepages, >> but mostly because T

Re: [PATCH v13 17/35] KVM: Add transparent hugepage support for dedicated guest memory

2023-11-02 Thread Paolo Bonzini
On Thu, Nov 2, 2023 at 4:38 PM Sean Christopherson wrote: > Actually, looking that this again, there's not actually a hard dependency on > THP. > A THP-enabled kernel _probably_ gives a higher probability of using > hugepages, > but mostly because THP selects COMPACTION, and I suppose because u

Re: [PATCH v13 17/35] KVM: Add transparent hugepage support for dedicated guest memory

2023-11-02 Thread Sean Christopherson
On Thu, Nov 02, 2023, Paolo Bonzini wrote: > On Wed, Nov 1, 2023 at 11:35 PM Sean Christopherson wrote: > > > > On Wed, Nov 01, 2023, Paolo Bonzini wrote: > > > On 11/1/23 17:36, Sean Christopherson wrote: > > > > Can you post a fixup patch? It's not clear to me exactly what behavior > > > > you

Re: [PATCH v13 17/35] KVM: Add transparent hugepage support for dedicated guest memory

2023-11-01 Thread Paolo Bonzini
On Wed, Nov 1, 2023 at 11:35 PM Sean Christopherson wrote: > > On Wed, Nov 01, 2023, Paolo Bonzini wrote: > > On 11/1/23 17:36, Sean Christopherson wrote: > > > > > "Allow" isn't perfect, e.g. I would much prefer a straight > > > > > KVM_GUEST_MEMFD_USE_HUGEPAGES > > > > > or KVM_GUEST_MEMFD_HUGE

Re: [PATCH v13 17/35] KVM: Add transparent hugepage support for dedicated guest memory

2023-11-01 Thread Sean Christopherson
On Wed, Nov 01, 2023, Paolo Bonzini wrote: > On 11/1/23 17:36, Sean Christopherson wrote: > > > > "Allow" isn't perfect, e.g. I would much prefer a straight > > > > KVM_GUEST_MEMFD_USE_HUGEPAGES > > > > or KVM_GUEST_MEMFD_HUGEPAGES flag, but I wanted the name to convey that > > > > KVM doesn't >

Re: [PATCH v13 17/35] KVM: Add transparent hugepage support for dedicated guest memory

2023-11-01 Thread Paolo Bonzini
On 11/1/23 17:36, Sean Christopherson wrote: "Allow" isn't perfect, e.g. I would much prefer a straight KVM_GUEST_MEMFD_USE_HUGEPAGES or KVM_GUEST_MEMFD_HUGEPAGES flag, but I wanted the name to convey that KVM doesn't (yet) guarantee hugepages. I.e. KVM_GUEST_MEMFD_ALLOW_HUGEPAGE is stronger t

Re: [PATCH v13 17/35] KVM: Add transparent hugepage support for dedicated guest memory

2023-11-01 Thread Sean Christopherson
On Wed, Nov 01, 2023, Paolo Bonzini wrote: > On Wed, Nov 1, 2023 at 2:41 PM Sean Christopherson wrote: > > > > On Wed, Nov 01, 2023, Xiaoyao Li wrote: > > > On 10/31/2023 10:16 PM, Sean Christopherson wrote: > > > > On Tue, Oct 31, 2023, Xiaoyao Li wrote: > > > > > On 10/28/2023 2:21 AM, Sean Chri

Re: [PATCH v13 17/35] KVM: Add transparent hugepage support for dedicated guest memory

2023-11-01 Thread Paolo Bonzini
On Wed, Nov 1, 2023 at 2:41 PM Sean Christopherson wrote: > > On Wed, Nov 01, 2023, Xiaoyao Li wrote: > > On 10/31/2023 10:16 PM, Sean Christopherson wrote: > > > On Tue, Oct 31, 2023, Xiaoyao Li wrote: > > > > On 10/28/2023 2:21 AM, Sean Christopherson wrote: > > > > > Extended guest_memfd to all

Re: [PATCH v13 17/35] KVM: Add transparent hugepage support for dedicated guest memory

2023-11-01 Thread Sean Christopherson
On Wed, Nov 01, 2023, Xiaoyao Li wrote: > On 10/31/2023 10:16 PM, Sean Christopherson wrote: > > On Tue, Oct 31, 2023, Xiaoyao Li wrote: > > > On 10/28/2023 2:21 AM, Sean Christopherson wrote: > > > > Extended guest_memfd to allow backing guest memory with transparent > > > > hugepages. Require use

Re: [PATCH v13 17/35] KVM: Add transparent hugepage support for dedicated guest memory

2023-11-01 Thread Xiaoyao Li
On 10/31/2023 10:16 PM, Sean Christopherson wrote: On Tue, Oct 31, 2023, Xiaoyao Li wrote: On 10/28/2023 2:21 AM, Sean Christopherson wrote: Extended guest_memfd to allow backing guest memory with transparent hugepages. Require userspace to opt-in via a flag even though there's no known/anticip

Re: [PATCH v13 17/35] KVM: Add transparent hugepage support for dedicated guest memory

2023-10-31 Thread Sean Christopherson
On Tue, Oct 31, 2023, Xiaoyao Li wrote: > On 10/28/2023 2:21 AM, Sean Christopherson wrote: > > Extended guest_memfd to allow backing guest memory with transparent > > hugepages. Require userspace to opt-in via a flag even though there's no > > known/anticipated use case for forcing small pages as

Re: [PATCH v13 17/35] KVM: Add transparent hugepage support for dedicated guest memory

2023-10-31 Thread Xiaoyao Li
On 10/28/2023 2:21 AM, Sean Christopherson wrote: Extended guest_memfd to allow backing guest memory with transparent hugepages. Require userspace to opt-in via a flag even though there's no known/anticipated use case for forcing small pages as THP is optional, i.e. to avoid ending up in a situ

[PATCH v13 17/35] KVM: Add transparent hugepage support for dedicated guest memory

2023-10-27 Thread Sean Christopherson
Extended guest_memfd to allow backing guest memory with transparent hugepages. Require userspace to opt-in via a flag even though there's no known/anticipated use case for forcing small pages as THP is optional, i.e. to avoid ending up in a situation where userspace is unaware that KVM can't provi