Re: [PATCH v1 04/18] mm: track mapcount of large folios in single value

2024-04-19 Thread Yin, Fengwei
On 4/10/2024 3:22 AM, David Hildenbrand wrote: Let's track the mapcount of large folios in a single value. The mapcount of a large folio currently corresponds to the sum of the entire mapcount and all page mapcounts. This sum is what we actually want to know in folio_mapcount() and it is also

Re: [PATCH v1 04/18] mm: track mapcount of large folios in single value

2024-04-18 Thread Lance Yang
On Thu, Apr 18, 2024 at 11:09 PM David Hildenbrand wrote: > > On 18.04.24 16:50, Lance Yang wrote: > > Hey David, > > > > FWIW, just a nit below. > > Hi! > Thanks for clarifying! > Thanks, but that was done on purpose. > > This way, we'll have a memory barrier (due to at least one > atomic_inc_a

Re: [PATCH v1 04/18] mm: track mapcount of large folios in single value

2024-04-18 Thread David Hildenbrand
On 18.04.24 16:50, Lance Yang wrote: Hey David, FWIW, just a nit below. Hi! Thanks, but that was done on purpose. This way, we'll have a memory barrier (due to at least one atomic_inc_and_test()) between incrementing the folio refcount (happening before the rmap change) and incrementing th

Re: [PATCH v1 04/18] mm: track mapcount of large folios in single value

2024-04-18 Thread Lance Yang
Hey David, FWIW, just a nit below. diff --git a/mm/rmap.c b/mm/rmap.c index 2608c40dffad..08bb6834cf72 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1143,7 +1143,6 @@ static __always_inline unsigned int __folio_add_rmap(struct folio *folio, int *nr_pmdmapped) { atomic_t *ma

Re: [PATCH v1 04/18] mm: track mapcount of large folios in single value

2024-04-10 Thread David Hildenbrand
On 09.04.24 22:13, Zi Yan wrote: On 9 Apr 2024, at 15:22, David Hildenbrand wrote: Let's track the mapcount of large folios in a single value. The mapcount of a large folio currently corresponds to the sum of the entire mapcount and all page mapcounts. This sum is what we actually want to know

Re: [PATCH v1 04/18] mm: track mapcount of large folios in single value

2024-04-09 Thread Zi Yan
On 9 Apr 2024, at 15:22, David Hildenbrand wrote: > Let's track the mapcount of large folios in a single value. The mapcount of > a large folio currently corresponds to the sum of the entire mapcount and > all page mapcounts. > > This sum is what we actually want to know in folio_mapcount() and it