Re: [PATCH WIP v1 07/20] mm/rmap_id: track if one ore multiple MMs map a partially-mappable folio

From: Nadav Amit
Date: Mon Dec 18 2023 - 09:35:09 EST




> On Dec 18, 2023, at 4:04 PM, David Hildenbrand <david@xxxxxxxxxx> wrote:
>
> But adding 1 "0" bit is not sufficient for handling order-2 folios (P = 4), only for handling order-1 folios. So what the current approach does is the following (P = 4):
>
> RMAP-ID | | Subid |
> -----------------------------------
> 0 | 0000 | 0 | 0000 0000
> 1 | 0001 | 1 | 0000 0001
> 2 | 0010 | 5 | 0000 0101
> 3 | 0011 | 6 | 0000 0110
> 4 | 0100 | 25 | 0001 1001
> 5 | 0101 | 26 | 0001 1010
> 6 | 0110 | 30 | 0001 1110
> 7 | 0111 | 31 | 0001 1111
> 8 | 1000 | 125 | 0111 1101
> 9 | 1001 | 126 | 0111 1110
> 10 | 1010 | 130 | 1000 0010
> 11 | 1011 | 131 | 1000 0011
> 12 | 1100 | 150 | 1001 0110
> 13 | 1101 | 151 | 1001 0111
> 14 | 1110 | 155 | 1001 1011
> 15 | 1111 | 156 | 1001 1100

Yes, of course. Silly me. You want to take advantage of the counter not
saturating for orders K where K-1 is not a power of 2.

I get your point. Not sure whether it worth the complexity though…