Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: Guillaume Morin <guillaume@morinfr.org>
Cc: osalvador@suse.de, avid@kernel.org, linux-mm@kvack.org,
	 riel@surriel.com, Muchun Song <muchun.song@linux.dev>
Subject: Re: [BUG] mm/hugetlb: possible temporary resv underflow
Date: Tue, 14 Jul 2026 04:14:32 -0700	[thread overview]
Message-ID: <alYZ7fso3zp3j3jv@gmail.com> (raw)
In-Reply-To: <alYT8J9aRQDx_8pP@bender.morinfr.org>

On Tue, Jul 14, 2026 at 12:48:16PM +0200, Guillaume Morin wrote:
> > > I am not sure what the best fix is but checking folio_mapcount() == 0 
> > > in __unmap_hugepage_range() seems to do the trick
> > > 
> > >                 adjust_reservation = false;
> > >  
> > >                 spin_lock_irq(&hugetlb_lock);
> > >                 if (!h->surplus_huge_pages && __vma_private_lock(vma) &&
> > > -                   folio_test_anon(folio)) {
> > > +                   folio_test_anon(folio) &&
> > > +                   folio_mapcount(folio) == 0) {
> > >                         folio_set_hugetlb_restore_reserve(page_folio(page));
> > >                         /* Reservation to be adjusted after the spin lock */
> > >                         adjust_reservation = true;
> > 
> > The fix looks correct to me.
> 
> Excellent! Will you be submitting a patch or do you need me to do
> something there?

Up to you. You can either send it, or, I  can do it myself.


      reply	other threads:[~2026-07-14 11:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-10 15:02 [BUG] mm/hugetlb: possible temporary resv underflow Guillaume Morin
2026-07-13  9:43 ` Breno Leitao
2026-07-14 10:39   ` Guillaume Morin
2026-07-14 10:48   ` Guillaume Morin
2026-07-14 11:14     ` Breno Leitao [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alYZ7fso3zp3j3jv@gmail.com \
    --to=leitao@debian.org \
    --cc=avid@kernel.org \
    --cc=guillaume@morinfr.org \
    --cc=linux-mm@kvack.org \
    --cc=muchun.song@linux.dev \
    --cc=osalvador@suse.de \
    --cc=riel@surriel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox