Hi Luiz,

On Wed, May 13, 2026 at 03:50:39PM -0400, Luiz Capitulino wrote:
> On 2026-05-11 12:28, Mike Rapoport wrote:
> > +static bool __hugetlb_setup(unsigned long size, unsigned long nr)
> > +{
> > +   unsigned long free = hugetlb_free_pages(size);
> > +   unsigned long total = hugetlb_nr_pages(size);
> > +
> > +   if (free >= nr)
> > +           return true;
> > +
> > +   hugetlb_set_nr_pages(size, total + (nr - free));
> 
> We're using 'total' to preserve the HugeTLB reservation that's already
> there, right? I guess this won't have the desirable effect because the
> tests calling hugetlb_setup_default_exact() will override this anyways.

Even the tests that call hugetlb_setup_default_exact() restore the
original settings, so if there were N huge pages and all of them are free,
after the test we still will have N huge pages.
And if there are already allocated huge pages, tests that require an exact
number of huge pages will skip.

And if all the tests run sequentially in a clean environment it wouldn't
matter. 
 
> Having said that, this is just a minor nit and not a bug, so:
> 
> Reviewed-by: Luiz Capitulino <[email protected]>

Thanks!
 
-- 
Sincerely yours,
Mike.

Reply via email to