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.

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