From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Luke Yang <luyang@redhat.com>, dev.jain@arm.com
Cc: jhladky@redhat.com, akpm@linux-foundation.org,
Liam.Howlett@oracle.com, willy@infradead.org, surenb@google.com,
vbabka@suse.cz, linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [REGRESSION] mm/mprotect: 2x+ slowdown for >=400KiB regions since PTE batching (cac1db8c3aad)
Date: Wed, 18 Feb 2026 14:29:44 +0100 [thread overview]
Message-ID: <e5c037ac-ae57-408c-8b89-cef4e5951b5e@kernel.org> (raw)
In-Reply-To: <aY8-XuFZ7zCvXulB@luyang-thinkpadp1gen7.toromso.csb>
> int main(int argc, char **argv)
> {
> int i, j, ret;
> long long k;
>
> if (argc < 4) {
> printf("USAGE: %s region_size_kib region_count iterations\n", argv[0]);
> printf("Creates multiple regions and times mprotect() calls\n");
> return 1;
> }
>
> long region_size = atol(argv[1]) * 1024L;
> int region_count = atoi(argv[2]);
> int iterations = atoi(argv[3]);
>
> int pagesize = sysconf(_SC_PAGESIZE);
>
> vchar_t **regions = malloc(region_count * sizeof(vchar_t*));
> if (!regions) {
> perror("malloc");
> return 1;
> }
>
> for (i = 0; i < region_count; i++) {
> regions[i] = (vchar_t *) mmap(NULL, region_size,
> PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0L);
>
I assume that the regression might be more pronounced with MAP_SHARED,
because there we really didn't ever required the page/folio during
mprotect() IIRC.
--
Cheers,
David
prev parent reply other threads:[~2026-02-18 13:29 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-13 15:08 Luke Yang
2026-02-13 15:47 ` David Hildenbrand (Arm)
2026-02-13 16:24 ` Pedro Falcato
2026-02-13 17:16 ` Suren Baghdasaryan
2026-02-13 17:26 ` David Hildenbrand (Arm)
2026-02-16 10:12 ` Dev Jain
2026-02-16 14:56 ` Pedro Falcato
2026-02-17 17:43 ` Luke Yang
2026-02-17 18:08 ` Pedro Falcato
2026-02-18 5:01 ` Dev Jain
2026-02-18 10:06 ` Pedro Falcato
2026-02-18 10:38 ` Dev Jain
2026-02-18 10:46 ` David Hildenbrand (Arm)
2026-02-18 11:58 ` Pedro Falcato
2026-02-18 12:24 ` David Hildenbrand (Arm)
2026-02-19 12:15 ` Pedro Falcato
2026-02-19 13:02 ` David Hildenbrand (Arm)
2026-02-19 15:00 ` Pedro Falcato
2026-02-19 15:29 ` David Hildenbrand (Arm)
2026-02-20 4:12 ` Dev Jain
2026-02-18 11:52 ` Pedro Falcato
2026-02-18 4:50 ` Dev Jain
2026-02-18 13:29 ` David Hildenbrand (Arm) [this message]
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=e5c037ac-ae57-408c-8b89-cef4e5951b5e@kernel.org \
--to=david@kernel.org \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=dev.jain@arm.com \
--cc=jhladky@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luyang@redhat.com \
--cc=surenb@google.com \
--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