Re: [PATCH] Documentation: coding-style: don't encourage WARN*()

2024-04-19 Thread David Hildenbrand
On 14.04.24 19:08, Alex Elder wrote: Several times recently Greg KH has admonished that variants of WARN() should not be used, because when the panic_on_warn kernel option is set, their use can lead to a panic. His reasoning was that the majority of Linux instances (including Android and cloud sy

Re: [PATCH v1 02/18] mm/rmap: always inline anon/file rmap duplication of a single PTE

2024-04-19 Thread David Hildenbrand
On 19.04.24 04:25, Yin, Fengwei wrote: On 4/10/2024 3:22 AM, David Hildenbrand wrote: As we grow the code, the compiler might make stupid decisions and unnecessarily degrade fork() performance. Let's make sure to always inline functions that operate on a single PTE so the compiler will always

Re: [PATCH v1 05/18] mm: improve folio_likely_mapped_shared() using the mapcount of large folios

2024-04-19 Thread David Hildenbrand
On 19.04.24 04:29, Yin, Fengwei wrote: On 4/10/2024 3:22 AM, David Hildenbrand wrote: @@ -2200,7 +2200,22 @@ static inline size_t folio_size(struct folio *folio) */ static inline bool folio_likely_mapped_shared(struct folio *folio) { - return page_mapcount(folio_page(folio, 0))

Re: [PATCH v1 05/18] mm: improve folio_likely_mapped_shared() using the mapcount of large folios

2024-04-19 Thread Yin, Fengwei
On 4/19/2024 5:19 PM, David Hildenbrand wrote: On 19.04.24 04:29, Yin, Fengwei wrote: On 4/10/2024 3:22 AM, David Hildenbrand wrote: @@ -2200,7 +2200,22 @@ static inline size_t folio_size(struct folio *folio)     */    static inline bool folio_likely_mapped_shared(struct folio *folio)   

Re: [PATCH v1 05/18] mm: improve folio_likely_mapped_shared() using the mapcount of large folios

2024-04-19 Thread David Hildenbrand
On 19.04.24 15:47, Yin, Fengwei wrote: On 4/19/2024 5:19 PM, David Hildenbrand wrote: On 19.04.24 04:29, Yin, Fengwei wrote: On 4/10/2024 3:22 AM, David Hildenbrand wrote: @@ -2200,7 +2200,22 @@ static inline size_t folio_size(struct folio *folio)     */    static inline bool folio_likel

Re: [PATCH v1 02/18] mm/rmap: always inline anon/file rmap duplication of a single PTE

2024-04-19 Thread Yin, Fengwei
On 4/10/2024 3:22 AM, David Hildenbrand wrote: As we grow the code, the compiler might make stupid decisions and unnecessarily degrade fork() performance. Let's make sure to always inline functions that operate on a single PTE so the compiler will always optimize out the loop and avoid a funct

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 05/18] mm: improve folio_likely_mapped_shared() using the mapcount of large folios

2024-04-19 Thread Yin, Fengwei
On 4/10/2024 3:22 AM, David Hildenbrand wrote: We can now read the mapcount of large folios very efficiently. Use it to improve our handling of partially-mappable folios, falling back to making a guess only in case the folio is not "obviously mapped shared". We can now better detect partially

Re: [PATCH v1 03/18] mm/rmap: add fast-path for small folios when adding/removing/duplicating

2024-04-19 Thread Yin, Fengwei
On 4/10/2024 3:22 AM, David Hildenbrand wrote: Let's add a fast-path for small folios to all relevant rmap functions. Note that only RMAP_LEVEL_PTE applies. This is a preparation for tracking the mapcount of large folios in a single value. Signed-off-by: David Hildenbrand Reviewed-by: Yin