On Thu, Sep 10, 2026 at 12:59:14PM +0800, Baolin Wang wrote:
> > +static bool all_windows_at_order(void *p, size_t len)
> > +{
> > +   return is_range_backed_by_order(p, len, collapse_order,
> > +                                   pagemap_fd, kpageflags_fd);
> 
> Like I mentioned in patch 8, you can implement these helpers using
> check_large_folios() in vm_util.c. Then you do not need to add new
> 'pagemap_fd' and 'kpageflags_fd' variables.

As I mentioned in reply to patch 8, I don't like that
check_large_folios() keeps re-opening file descriptors per call.

> > @@ -1375,6 +1569,20 @@ int main(int argc, char **argv)
> >     parse_test_type(argc, argv);
> > +   if (mthp_khugepaged_context &&
> > +       !(thp_supported_orders() & (1UL << collapse_order)))
> > +           ksft_exit_skip("Order %d is not a supported anon THP order\n",
> > +                          collapse_order);
> 
> This check can be moved into parse_test_type(), where the 'mthp_khugepaged'
> parameter is parsed.

Patch 14 makes -c optional and turns this into the code that builds the
list of orders to run, next to the "-c has to be above -s" check.  That
list wants thp_supported_orders() and belongs after parsing rather than in
it, so I left parse_test_type() to the range check.

> > @@ -1425,6 +1633,10 @@ int main(int argc, char **argv)
> >     TEST(collapse_empty, madvise_context, anon_ops);
> >     TEST(collapse_single_mthp, mthp_khugepaged_context, anon_ops);
> > +   TEST(collapse_order_single_window, mthp_khugepaged_context, anon_ops);
> > +   TEST(collapse_order_partial_window, mthp_khugepaged_context, anon_ops);
> > +   TEST(collapse_order_max_ptes_none, mthp_khugepaged_context, anon_ops);
> > +   TEST(collapse_order_mixed_sources, mthp_khugepaged_context, anon_ops);
> 
> These test cases look good to me. Thanks.

Thanks for going through them!

-- 
  Kiryl Shutsemau / Kirill A. Shutemov

Reply via email to