From: David Hildenbrand <david@redhat.com>
To: Guillaume Morin <guillaume@morinfr.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Muchun Song <muchun.song@linux.dev>,
Andrew Morton <akpm@linux-foundation.org>,
Peter Xu <peterx@redhat.com>,
Eric Hagberg <ehagberg@janestreet.com>
Subject: Re: [PATCH v1] hugetlb: support FOLL_FORCE|FOLL_WRITE
Date: Wed, 4 Dec 2024 20:30:14 +0100 [thread overview]
Message-ID: <77838f94-f333-4973-858f-ea2964ea7b9e@redhat.com> (raw)
In-Reply-To: <Z1Cp2t6LNf3trdNf@bender.morinfr.org>
On 04.12.24 20:13, Guillaume Morin wrote:
> On 04 Dec 20:01, David Hildenbrand wrote:
>>
>> On 04.12.24 19:26, Guillaume Morin wrote:
>>
>> Patch prefix should likely be "mm/hugetlb: ..."
>>
>>> FOLL_FORCE|FOLL_WRITE has never been properly supported for hugetlb
>>> mappings. Since 1d8d14641fd94, we explicitly reject it. However
>>
>> "Since commit 1d8d14641fd9 ("mm/hugetlb: support write-faults in shared
>> mappings") ..."
>
> Will fix in v2.
>
>>
>>> running software on hugetlb mappings is a useful optimization.
>>> Multiple tools allow to use that such as Intel iodlr or
>>> libhugetlbfs.
>>
>> It would be better to link to the actual request where people ran into that
>> when using PTRACE_POKETEXT
>>
>> That hugetlb is getting used is rather obvious :)
>
> Well, allow me to point out that I said running software on a hugetlb
> mapping, not generally using hugetlb.
Well, yes, but that's not really big news. People have been doing that
(and rewriting their apps using libhugetlbfs to place text on huge pages
pre file THP) for decades. :)
See below.
>
> That said, which link are you referring to? The only discussion I am
> aware of is off mailing lists.
Oh, indeed, I could have sworn it was public.
I'd write something like
"Eric reported that PTRACE_POKETEXT fails when applications use hugetlb
for mapping text using huge pages. Before commit 1d8d14641fd9,
PTRACE_POKETEXT worked by accident, but it was buggy and silently ended
up mapping pages writable into the page tables even though VM_WRITE was
not set.
In general, FOLL_FORCE|FOLL_WRITE does currently not work with hugetlb.
Let's implement FOLL_FORCE|FOLL_WRITE properly for hugetlb, such that
what used to work in the past by accident now properly works, allowing
applications using hugetlb for text etc. to get properly debugged.
This change might also be required to implement uprobes support for
hugetlb [1].
[1] link to our discussion
"
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2024-12-04 19:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-04 18:26 Guillaume Morin
2024-12-04 19:01 ` David Hildenbrand
2024-12-04 19:13 ` Guillaume Morin
2024-12-04 19:30 ` David Hildenbrand [this message]
2024-12-05 0:39 ` kernel test robot
2024-12-05 1:42 ` Guillaume Morin
2024-12-05 1:56 ` Guillaume Morin
2024-12-05 1:23 ` kernel test robot
2024-12-05 2:05 ` kernel test robot
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=77838f94-f333-4973-858f-ea2964ea7b9e@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=ehagberg@janestreet.com \
--cc=guillaume@morinfr.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=muchun.song@linux.dev \
--cc=peterx@redhat.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