From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Qi Zheng <zhengqi.arch@bytedance.com>,
muchun.song@linux.dev, osalvador@suse.de,
akpm@linux-foundation.org, azpijr@gmail.com,
lance.yang@linux.dev, Qi Zheng <qi.zheng@linux.dev>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, stable@vger.kernel.org
Subject: Re: [PATCH v3 2/3] mm: gup: allow long-term pins of CMA-allocated HugeTLB folios
Date: Thu, 12 Nov 2026 09:40:57 +0100 [thread overview]
Message-ID: <8712ee27-85b0-4342-a3f5-7e9b4425b804@kernel.org> (raw)
In-Reply-To: <5f68ffba-9f56-4e31-9e7c-9d110f552efc@bytedance.com>
On 11/11/26 11:26, Qi Zheng wrote:
> Hi David,
>
> On 11/11/26 3:43 PM, David Hildenbrand (Arm) wrote:
>> On 11/9/26 04:10, Qi Zheng wrote:
>>>
>>>
>>>
>>
>> You resent your series way too fast.
>
> Got it.
>
>>
>> Now we have discussions in to threads, congratulations ;)
>>
>>> ;), got it.
>>>
>>> I moved the code to resolve a build dependency.
>>>
>>
>> Why can't that be resolved differently? What is the dependency?
>
> The dependency is that the new check wants to use
> `folio_test_hugetlb_cma()`, which is a HugeTLB-specific inline helper
> from `include/linux/hugetlb.h`.
>
> `folio_is_longterm_pinnable()` currently lives in `include/linux/mm.h`,
> while `include/linux/hugetlb.h` already includes `linux/mm.h`. So I
> can't simply use `folio_test_hugetlb_cma()` from `mm.h`
It's all so hacky. :)
core-mm shouldn't have to worry about hugetlb internals like
folio_test_hugetlb_cma().
>>>
>>> A generic query may need separate ownership tracking, such as an
>>> owned_bitmap recording successfully allocated pages. Its updates and
>>> lookups would also need to handle concurrency with fast GUP.
>>
>> Or simply two bitmaps? "trying allocation - allocated"
>
> As a fix, perhaps this is a bit too complex? :(
>
> Alternatively, we could adjust the timing for setting the bitmap, though
> this might introduce new concurrency issues.
I think we had that order reversed in the past. Likely a second bitmap would
allow us to fix it fairly easily.
--
Cheers,
David
next prev parent reply other threads:[~2026-11-12 8:41 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-07 10:30 [PATCH v3 0/3] mm: hugetlb: fix CMA-related issues Qi Zheng
2026-11-07 10:30 ` [PATCH v3 1/3] x86: hugetlb: disable default CMA reservations on 32-bit kernel Qi Zheng
2026-11-07 10:30 ` [PATCH v3 2/3] mm: gup: allow long-term pins of CMA-allocated HugeTLB folios Qi Zheng
2026-11-07 17:58 ` David Hildenbrand (Arm)
2026-11-09 3:10 ` Qi Zheng
2026-11-11 7:43 ` David Hildenbrand (Arm)
2026-11-11 10:26 ` Qi Zheng
2026-11-11 22:26 ` Frank van der Linden
2026-11-12 3:27 ` Qi Zheng
2026-11-12 8:36 ` David Hildenbrand (Arm)
2026-11-12 8:40 ` David Hildenbrand (Arm) [this message]
2026-11-07 10:30 ` [PATCH v3 3/3] mm: hugetlb: fix GFP mask propagation to CMA Qi Zheng
2026-11-07 17:02 ` Oscar Salvador (SUSE)
2026-11-09 3:10 ` Qi Zheng
2026-11-11 22:05 ` [PATCH v3 0/3] mm: hugetlb: fix CMA-related issues David Hildenbrand (Arm)
2026-11-12 3:25 ` 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=8712ee27-85b0-4342-a3f5-7e9b4425b804@kernel.org \
--to=david@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=azpijr@gmail.com \
--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