[PATCH v2 0/3] Optimizations for khugepaged

Dev Jain posted 3 patches 3 months, 2 weeks ago
There is a newer version of this series
mm/khugepaged.c | 77 ++++++++++++++++++++++++++++++++++++-------------
1 file changed, 57 insertions(+), 20 deletions(-)
[PATCH v2 0/3] Optimizations for khugepaged
Posted by Dev Jain 3 months, 2 weeks ago
This patch series uses PTE batching to optimize two functions, and
also addresses a race condition.

---
@David I did not make the clear_full_ptes clean up since that will require
some more work than I originally thought :)

v1->v2:
 - Use for loop instead of do-while loop (Lorenzo)
 - Remove folio_test_large check since the subpage-check condition
   will imply that (Baolin)
 - Combine patch 1 and 2 into this series, add new patch 3

Dev Jain (3):
  khugepaged: Optimize __collapse_huge_page_copy_succeeded() by PTE
    batching
  khugepaged: Optimize collapse_pte_mapped_thp() for large folios by PTE
    batching
  khugepaged: Reduce race probability between migration and khugepaged

 mm/khugepaged.c | 77 ++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 57 insertions(+), 20 deletions(-)

-- 
2.30.2
Re: [PATCH v2 0/3] Optimizations for khugepaged
Posted by Lorenzo Stoakes 3 months, 2 weeks ago
On Wed, Jun 25, 2025 at 11:28:03AM +0530, Dev Jain wrote:
> This patch series uses PTE batching to optimize two functions, and
> also addresses a race condition.

Kinda succinct, be nice to expand a little. I know it can end up being a
little duplicative, but I think more information is always better than less
(as long as not truly overwrought)

>
> ---
> @David I did not make the clear_full_ptes clean up since that will require
> some more work than I originally thought :)
>
> v1->v2:
>  - Use for loop instead of do-while loop (Lorenzo)
>  - Remove folio_test_large check since the subpage-check condition
>    will imply that (Baolin)
>  - Combine patch 1 and 2 into this series, add new patch 3

One small nit, it'd be really handy to include links to previous series to
help us find them :P

As this one combines a couple earlier (which is nice!) but handy just for
comparison's sake :>)

>
> Dev Jain (3):
>   khugepaged: Optimize __collapse_huge_page_copy_succeeded() by PTE
>     batching
>   khugepaged: Optimize collapse_pte_mapped_thp() for large folios by PTE
>     batching
>   khugepaged: Reduce race probability between migration and khugepaged
>
>  mm/khugepaged.c | 77 ++++++++++++++++++++++++++++++++++++-------------
>  1 file changed, 57 insertions(+), 20 deletions(-)
>
> --
> 2.30.2
>