> > diff --git a/tools/testing/selftests/mm/soft-dirty.c 
> > b/tools/testing/selftests/mm/soft-dirty.c
> > index 5f278913c4d7..b6fad38c8bee 100644
> > --- a/tools/testing/selftests/mm/soft-dirty.c
> > +++ b/tools/testing/selftests/mm/soft-dirty.c
> > @@ -92,9 +92,9 @@ static void test_hugepage(int pagemap_fd, int pagesize)
> >     if (!hpage_len)
> >             ksft_exit_fail_msg("Reading PMD pagesize failed");
> >  
> > -   map = memalign(hpage_len, hpage_len);
> > +   map = alloc_isolated_mem(hpage_len, hpage_len);
> >     if (!map)
> > -           ksft_exit_fail_msg("memalign failed\n");
> > +           ksft_exit_fail_msg("alloc_isolated_mem failed\n");
> >  
> >     ret = madvise(map, hpage_len, MADV_HUGEPAGE);
> >     if (ret)
> > @@ -130,7 +130,7 @@ static void test_hugepage(int pagemap_fd, int pagesize)
> >             ksft_test_result_skip("Test %s huge page allocation\n", 
> > __func__);
> >             ksft_test_result_skip("Test %s huge page dirty bit\n", 
> > __func__);
> >     }
> > -   free(map);
> > +   free_isolated_mem(map, hpage_len);
> >  }
> 
> smaps is really only problematic with merged VMAs when relying on exact page
> statistics. For other properties (vm flags, MMUPageSize) it's not a problem as
> long as our smap search just finds the VMA that covers an address.
> 
> Assuming we fixed check_huge_anon() to not use smaps, why is this change here
> required?

Since there is no interface to get vm_flags not via /proc/self/smaps,
It might be good to have it for preventing unwanted VMA merge.

And might be useful for future to prevent unwated VMA merge.

-- 
Sincerely,
Yeoreum Yun

Reply via email to