Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "David Hildenbrand (Arm)" <david@kernel.org>,
	Qi Zheng <qi.zheng@linux.dev>,
	muchun.song@linux.dev, osalvador@suse.de, azpijr@gmail.com,
	lance.yang@linux.dev, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, Qi Zheng <zhengqi.arch@bytedance.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH v2 2/4] mm: gup: allow long-term pins of CMA-allocated HugeTLB folios
Date: Tue, 1 Dec 2026 21:54:24 +0100	[thread overview]
Message-ID: <aw80AOn5-tG_COhy@tiehlicka> (raw)
In-Reply-To: <20261201122831.7ea6961660bd88cef8994fc6@linux-foundation.org>

On Tue 01-12-26 12:28:31, Andrew Morton wrote:
> On Tue, 1 Dec 2026 11:50:01 +0100 "David Hildenbrand (Arm)" <david@kernel.org> wrote:
> 
> > On 12/1/26 11:38, Michal Hocko wrote:
> > > On Tue 01-12-26 10:26:03, David Hildenbrand wrote:
> > >> On 12/1/26 10:12, Michal Hocko wrote:
> > >>>
> > >>> Sorry to chime in this late but I just learned about this change
> > >>> recently. I have to say I am quite surprised that long term pins
> > >>> failed on their own cmas. Is there any actual usecase to require those
> > >>> to work out there?
> > >>>
> > >>> I have no objections to the patch but I want to learn about why nobody
> > >>> cared until just now.
> > >>
> > >> I previously had reports from people using hugetlb_cma for backing VMs and just
> > >> wanting to use vfio for device-passthrough.
> > > 
> > > OK, so there is an explicit request behind that. So probably good to
> > > have that mentioned in the changelog so that we have that for future
> > > reference.
> > 
> > I remember a discussion at LPC about that, where people also raised the demand
> > for PMD allocations from hugetlb areas [2], which apparently in combination
> > makes that easier to hit for some workloads.
> > 
> > Yes, we should highlight that in the commit message.
> 
> I did this to the changelog:
> 
> --- a/txt/mm-gup-allow-long-term-pins-of-cma-allocated-hugetlb-folios.txt
> +++ b/txt/mm-gup-allow-long-term-pins-of-cma-allocated-hugetlb-folios.txt
> @@ -12,6 +12,10 @@ through HPG_cma.  Allow them to be pinned even in ZONE_MOVABLE, since
>  memory blocks overlapping boot-time CMA areas cannot be offlined. 
>  Ordinary movable allocations that borrow CMA memory remain unpinnable.
>  
> +One use case is VMs backed by hugetlb_cma whose users want VFIO device
> +passthrough. VFIO needs long-term pins of guest memory; currently those
> +pins can fail or unnecessarily migrate the HugeTLB folios out of CMA.
> +

Thanks Andrew!

>  Link: https://patch.msgid.link/295af6601ce79f2c2b3dc4352a3279f0e6ac513e.1794907279.git.zhengqi.arch@bytedance.com
>  Fixes: cf11e85fc08c ("mm: hugetlb: optionally allocate gigantic hugepages using cma")
>  Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
> 
> 
> > [2] https://lkml.kernel.org/r/cover.1792651104.git.zhengqi.arch@bytedance.com

-- 
Michal Hocko
SUSE Labs

  parent reply	other threads:[~2026-12-01 20:54 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1793850539.git.zhengqi.arch@bytedance.com>
2026-11-05  4:07 ` [PATCH v2 1/4] x86: hugetlb: disable default CMA reservations on 32-bit kernel Qi Zheng
2026-11-05  9:29   ` Oscar Salvador (SUSE)
2026-11-05  4:07 ` [PATCH v2 2/4] mm: gup: allow long-term pins of CMA-allocated HugeTLB folios Qi Zheng
2026-11-05  5:13   ` Muchun Song
2026-11-06  2:48     ` Qi Zheng
2026-11-06  2:54       ` Muchun Song
2026-11-05  9:33   ` Oscar Salvador (SUSE)
2026-11-05 11:28   ` Jose A. Perez de Azpillaga
2026-12-01  9:12   ` Michal Hocko
2026-12-01  9:26     ` David Hildenbrand (Arm)
2026-12-01 10:38       ` Michal Hocko
2026-12-01 10:50         ` David Hildenbrand (Arm)
2026-12-01 20:28           ` Andrew Morton
2026-12-01 20:37             ` David Hildenbrand (Arm)
2026-12-01 20:54             ` Michal Hocko [this message]
2026-11-05  4:07 ` [PATCH v2 3/4] mm: hugetlb: fix GFP mask propagation to CMA Qi Zheng
2026-11-05  5:17   ` Muchun Song
2026-11-05 10:00   ` Oscar Salvador (SUSE)
2026-11-06  2:43     ` Qi Zheng
2026-11-06  5:50       ` Oscar Salvador (SUSE)
2026-11-06  6:12         ` Qi Zheng
2026-11-05 11:28   ` Jose A. Perez de Azpillaga
2026-11-05  4:07 ` [PATCH v2 4/4] mm: hugetlb: fix cpuset violations in gigantic surplus allocations Qi Zheng

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=aw80AOn5-tG_COhy@tiehlicka \
    --to=mhocko@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=azpijr@gmail.com \
    --cc=david@kernel.org \
    --cc=lance.yang@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=muchun.song@linux.dev \
    --cc=osalvador@suse.de \
    --cc=qi.zheng@linux.dev \
    --cc=stable@vger.kernel.org \
    --cc=zhengqi.arch@bytedance.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