https://bugs.kde.org/show_bug.cgi?id=514297

--- Comment #18 from [email protected] ---
Created attachment 190316
  --> https://bugs.kde.org/attachment.cgi?id=190316&action=edit
wip patch

Hello Philippe,  thank you for checking my patch!  I've been looking into it. 
This new guard pages mechanism was introduced in glibc upstream commit 
a6fbe36b7f31292981422692236465ab56670ea9. That is glibc-2.42.  IMHO The oldest
Fedora that can be used to test this with real life workloads is Fedora-44
(that's kernel-6.19.5-300.fc44.x86_64 and glibc-2.43-2.fc44).  I've used the
following systemtap script to monitor the madvise syscall system-wide:

# stap -ve 'probe syscall.madvise {printdln(" ", advice_str, execname())}'

Apparently, a guard page installation is rare.  One can trigger it with e.g.
`yum makecache`, some curl invocations or when cloning the valgrind sources
with git.  But typically just once per process lifetime.

You are right that is_valid_for() may become expensive with my patch, but only
where nsegments[i].hasGuardPages is True.  Having said all that, in practice
such condition is met with just a very few segments - typically zero or one in
practice.  So I'm not overly worried about it.  I might easily be mistaken
though.  Please let me know if you disagree.

I'm now attaching a new (still WIP) version of my patch.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to