From: Aleksandr Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
To: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: David Hildenbrand <david@redhat.com>,
James.Bottomley@hansenpartnership.com, Liam.Howlett@oracle.com,
akpm@linux-foundation.org, arnd@kernel.org, brauner@kernel.org,
chris@zankel.net, deller@gmx.de, hch@infradead.org,
jannh@google.com, jcmvbkbc@gmail.com, jeffxu@chromium.org,
jhubbard@nvidia.com, linux-api@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
mattst88@gmail.com, muchun.song@linux.dev, paulmck@kernel.org,
richard.henderson@linaro.org, shuah@kernel.org,
sidhartha.kumar@oracle.com, surenb@google.com,
tsbogend@alpha.franken.de, vbabka@suse.cz, willy@infradead.org,
criu@lists.linux.dev, Andrei Vagin <avagin@gmail.com>,
Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Subject: Re: [PATCH v4 0/5] implement lightweight guard pages
Date: Wed, 19 Mar 2025 16:15:21 +0100 [thread overview]
Message-ID: <CAEivzxeSupJXyCZthc=vGbocJ-AWCq_=q2f_hMKe7pe_83Q86Q@mail.gmail.com> (raw)
In-Reply-To: <23000b6a-8a58-4c38-a032-ad62637d3fa4@lucifer.local>
On Wed, Mar 19, 2025 at 4:02 PM Lorenzo Stoakes
<lorenzo.stoakes@oracle.com> wrote:
>
> On Wed, Mar 19, 2025 at 03:52:56PM +0100, David Hildenbrand wrote:
> > On 19.03.25 15:50, Alexander Mikhalitsyn wrote:
> > > On Mon, Oct 28, 2024 at 02:13:26PM +0000, Lorenzo Stoakes wrote:
>
> [snip]
>
>
> > >
> > > Dear Lorenzo,
> > > Dear colleagues,
> > >
> > > sorry about raising an old thread.
> > >
>
> No worries!
>
> > > It looks like this feature is now used in glibc [1]. And we noticed failures in CRIU [2]
> > > CI on Fedora Rawhide userspace. Now a question is how we can properly detect such
> > > "guarded" pages from user space. As I can see from MADV_GUARD_INSTALL implementation,
> > > it does not modify VMA flags anyhow, but only page tables. It means that /proc/<pid>/maps
> > > and /proc/<pid>/smaps interfaces are useless in this case. (Please, correct me if I'm missing
> > > anything here.)
>
> Sorry to hear that.
No problem at all ;)
>
> > >
> > > I wonder if you have any ideas / suggestions regarding Checkpoint/Restore here. We (CRIU devs) are happy
> > > to develop some patches to bring some uAPI to expose MADV_GUARDs, but before going into this we decided
> > > to raise this question in LKML.
>
> There's no need.
>
> >
> >
> > See [1] and [2]
> >
> > [1]
> > https://lkml.kernel.org/r/cover.1740139449.git.lorenzo.stoakes@oracle.com
> > [2] https://lwn.net/Articles/1011366/
>
> As per David, there is already a feature heading for 6.15 which will allow
> this to be exposed by /proc/$pid/pagemap.
Yeah, that's indeed very helpful!
>
> In addition, I plan to add a 'maybe has guard regions' flag that can be
> observed in smaps to assist narrowing down which VMAs to check.
>
> However unfortunately due to the nature of the feature there is no getting
> around the need to traverse page tables.
>
> That thread (and LWN article :) go into extensive detail as to why. In
> essence - it's the basis of its design to express this information at the
> page table level only, and any attempt to encode this at the VMA level
> (other than a 'maybe' flag) would eliminate the purpose of the feature.
Thank you very much for these explanations!
I'll read the LWN article too.
>
> Let me know if there's any way I can help!
Keep in contact! ;)
Kind regards,
Alex
>
> Cheers, Lorenzo
>
> >
> >
> > --
> > Cheers,
> >
> > David / dhildenb
> >
next prev parent reply other threads:[~2025-03-19 15:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-28 14:13 Lorenzo Stoakes
2024-10-28 14:13 ` [PATCH v4 1/5] mm: pagewalk: add the ability to install PTEs Lorenzo Stoakes
2024-10-28 14:13 ` [PATCH v4 2/5] mm: add PTE_MARKER_GUARD PTE marker Lorenzo Stoakes
2024-10-28 14:13 ` [PATCH v4 3/5] mm: madvise: implement lightweight guard page mechanism Lorenzo Stoakes
2024-10-29 10:32 ` Vlastimil Babka
2024-10-28 14:13 ` [PATCH v4 4/5] tools: testing: update tools UAPI header for mman-common.h Lorenzo Stoakes
2024-10-28 14:13 ` [PATCH v4 5/5] selftests/mm: add self tests for guard page feature Lorenzo Stoakes
2024-10-28 18:24 ` [PATCH v4 0/5] implement lightweight guard pages SeongJae Park
2024-10-28 22:22 ` Lorenzo Stoakes
2025-03-19 14:50 ` Alexander Mikhalitsyn
2025-03-19 14:52 ` David Hildenbrand
2025-03-19 15:02 ` Lorenzo Stoakes
2025-03-19 15:15 ` Aleksandr Mikhalitsyn [this message]
2025-03-19 15:08 ` Aleksandr Mikhalitsyn
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='CAEivzxeSupJXyCZthc=vGbocJ-AWCq_=q2f_hMKe7pe_83Q86Q@mail.gmail.com' \
--to=aleksandr.mikhalitsyn@canonical.com \
--cc=James.Bottomley@hansenpartnership.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@kernel.org \
--cc=avagin@gmail.com \
--cc=brauner@kernel.org \
--cc=chris@zankel.net \
--cc=criu@lists.linux.dev \
--cc=david@redhat.com \
--cc=deller@gmx.de \
--cc=hch@infradead.org \
--cc=jannh@google.com \
--cc=jcmvbkbc@gmail.com \
--cc=jeffxu@chromium.org \
--cc=jhubbard@nvidia.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mattst88@gmail.com \
--cc=muchun.song@linux.dev \
--cc=paulmck@kernel.org \
--cc=ptikhomirov@virtuozzo.com \
--cc=richard.henderson@linaro.org \
--cc=shuah@kernel.org \
--cc=sidhartha.kumar@oracle.com \
--cc=surenb@google.com \
--cc=tsbogend@alpha.franken.de \
--cc=vbabka@suse.cz \
--cc=willy@infradead.org \
/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