Re: [v2 PATCH] mm: thp: handle page cache THP correctly in PageTransCompoundMap

2019-10-23 Thread Yang Shi
On 10/23/19 12:28 PM, Hugh Dickins wrote: On Thu, 24 Oct 2019, Yang Shi wrote: We have usecase to use tmpfs as QEMU memory backend and we would like to take the advantage of THP as well. But, our test shows the EPT is not PMD mapped even though the underlying THP are PMD mapped on host.

[v3 PATCH] mm: thp: handle page cache THP correctly in PageTransCompoundMap

2019-10-23 Thread Yang Shi
We have usecase to use tmpfs as QEMU memory backend and we would like to take the advantage of THP as well. But, our test shows the EPT is not PMD mapped even though the underlying THP are PMD mapped on host. The number showed by /sys/kernel/debug/kvm/largepage is much less than the number of PMD

Re: [v2 PATCH] mm: thp: handle page cache THP correctly in PageTransCompoundMap

2019-10-23 Thread Hugh Dickins
On Thu, 24 Oct 2019, Yang Shi wrote: > We have usecase to use tmpfs as QEMU memory backend and we would like to > take the advantage of THP as well. But, our test shows the EPT is not > PMD mapped even though the underlying THP are PMD mapped on host. > The number showed by

Re: [v2 PATCH] mm: thp: handle page cache THP correctly in PageTransCompoundMap

2019-10-23 Thread Hugh Dickins
On Wed, 23 Oct 2019, Yang Shi wrote: > On 10/23/19 10:24 AM, Matthew Wilcox wrote: > > On Thu, Oct 24, 2019 at 01:05:04AM +0800, Yang Shi wrote: > > > + return map_count >= 0 && > > > +map_count == atomic_read([1].compound_mapcount); > > > } > > I didn't like Hugh's duplicate definition

Re: [v2 PATCH] mm: thp: handle page cache THP correctly in PageTransCompoundMap

2019-10-23 Thread Yang Shi
On 10/23/19 10:24 AM, Matthew Wilcox wrote: On Thu, Oct 24, 2019 at 01:05:04AM +0800, Yang Shi wrote: + return map_count >= 0 && + map_count == atomic_read([1].compound_mapcount); } I didn't like Hugh's duplicate definition either. May I suggest: Thanks, Willy. It is

Re: [v2 PATCH] mm: thp: handle page cache THP correctly in PageTransCompoundMap

2019-10-23 Thread Matthew Wilcox
On Thu, Oct 24, 2019 at 01:05:04AM +0800, Yang Shi wrote: > + return map_count >= 0 && > +map_count == atomic_read([1].compound_mapcount); > } I didn't like Hugh's duplicate definition either. May I suggest: diff --git a/include/linux/mm.h b/include/linux/mm.h index

[v2 PATCH] mm: thp: handle page cache THP correctly in PageTransCompoundMap

2019-10-23 Thread Yang Shi
We have usecase to use tmpfs as QEMU memory backend and we would like to take the advantage of THP as well. But, our test shows the EPT is not PMD mapped even though the underlying THP are PMD mapped on host. The number showed by /sys/kernel/debug/kvm/largepage is much less than the number of PMD

Re: [PATCH] mm: thp: handle page cache THP correctly in PageTransCompoundMap

2019-10-23 Thread Yang Shi
On 10/22/19 6:31 PM, Hugh Dickins wrote: On Tue, 22 Oct 2019, Yang Shi wrote: On 10/22/19 3:27 PM, Hugh Dickins wrote: I completely agree that the current PageTransCompoundMap() is wrong. A fix for that is one of many patches I've not yet got to upstreaming. Comparing yours and mine, I'm

Re: [PATCH] mm: thp: handle page cache THP correctly in PageTransCompoundMap

2019-10-22 Thread Hugh Dickins
On Tue, 22 Oct 2019, Yang Shi wrote: > On 10/22/19 3:27 PM, Hugh Dickins wrote: > > > > I completely agree that the current PageTransCompoundMap() is wrong. > > > > A fix for that is one of many patches I've not yet got to upstreaming. > > Comparing yours and mine, I'm worried by your use of

Re: [PATCH] mm: thp: handle page cache THP correctly in PageTransCompoundMap

2019-10-22 Thread Yang Shi
On 10/22/19 3:27 PM, Hugh Dickins wrote: On Wed, 23 Oct 2019, Yang Shi wrote: We have usecase to use tmpfs as QEMU memory backend and we would like to take the advantage of THP as well. But, our test shows the EPT is not PMD mapped even though the underlying THP are PMD mapped on host. The

Re: [PATCH] mm: thp: handle page cache THP correctly in PageTransCompoundMap

2019-10-22 Thread Hugh Dickins
On Wed, 23 Oct 2019, Yang Shi wrote: > We have usecase to use tmpfs as QEMU memory backend and we would like to > take the advantage of THP as well. But, our test shows the EPT is not > PMD mapped even though the underlying THP are PMD mapped on host. > The number showed by

[PATCH] mm: thp: handle page cache THP correctly in PageTransCompoundMap

2019-10-22 Thread Yang Shi
We have usecase to use tmpfs as QEMU memory backend and we would like to take the advantage of THP as well. But, our test shows the EPT is not PMD mapped even though the underlying THP are PMD mapped on host. The number showed by /sys/kernel/debug/kvm/largepage is much less than the number of PMD