Re: [PATCH v1 09/11] mm/memory: optimize fork() with PTE-mapped THP

2024-01-23 Thread Ryan Roberts
On 23/01/2024 12:19, David Hildenbrand wrote: > [...] > >> >> I wrote some documentation for this (based on Matthew's docs for set_ptes() >> in >> my version. Perhaps it makes sense to add it here, given this is overridable >> by >> the arch. >> >> /** >>   * wrprotect_ptes - Write protect a con

Re: [PATCH v1 09/11] mm/memory: optimize fork() with PTE-mapped THP

2024-01-23 Thread David Hildenbrand
[...] I wrote some documentation for this (based on Matthew's docs for set_ptes() in my version. Perhaps it makes sense to add it here, given this is overridable by the arch. /** * wrprotect_ptes - Write protect a consecutive set of pages. * @mm: Address space that the pages are mapped int

Re: [PATCH v1 09/11] mm/memory: optimize fork() with PTE-mapped THP

2024-01-23 Thread Ryan Roberts
On 22/01/2024 19:41, David Hildenbrand wrote: > Let's implement PTE batching when consecutive (present) PTEs map > consecutive pages of the same large folio, and all other PTE bits besides > the PFNs are equal. > > We will optimize folio_pte_batch() separately, to ignore some other > PTE bits. Thi

[PATCH v1 09/11] mm/memory: optimize fork() with PTE-mapped THP

2024-01-22 Thread David Hildenbrand
Let's implement PTE batching when consecutive (present) PTEs map consecutive pages of the same large folio, and all other PTE bits besides the PFNs are equal. We will optimize folio_pte_batch() separately, to ignore some other PTE bits. This patch is based on work by Ryan Roberts. Use __always_in