Page MenuHomeFreeBSD

Coalesce TLB shootdowns of global PTEs in pmap_advise().
ClosedPublic

Authored by markj on Jan 8 2017, 8:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 3, 11:11 AM
Unknown Object (File)
Feb 1 2025, 7:17 AM
Unknown Object (File)
Dec 27 2024, 7:35 AM
Unknown Object (File)
Dec 20 2024, 5:11 PM
Unknown Object (File)
Oct 30 2024, 8:24 PM
Unknown Object (File)
Sep 26 2024, 5:36 AM
Unknown Object (File)
Sep 24 2024, 5:27 AM
Unknown Object (File)
Sep 16 2024, 3:27 PM
Subscribers
None

Details

Summary

As of r311346, execve frequently calls pmap_advise() on multi-page
subranges of the kernel pmap. Right now, we invalidate consecutive entries
individually, resulting in more IPIs than necessary.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 6678
Build 6895: arc lint + arc unit

Event Timeline

markj retitled this revision from to Coalesce TLB shootdowns of global PTEs in pmap_advise()..
markj edited the test plan for this revision. (Show Details)
markj updated this object.
markj added reviewers: alc, kib.
alc edited edge metadata.

The same change should apply to the i386 pmap.

This revision is now accepted and ready to land.Jan 8 2017, 10:43 PM

Why do we need to apply such great accuracy to the kernel pmap invalidation, while we do not care at all for the user pmaps ? What if you always set `anychanged``` if a pte was changed, and then at the end, near PMAP_UNLOCK(), do the pmap_invalidate_range() call if the var is true ?

In D9094#188033, @kib wrote:

Why do we need to apply such great accuracy to the kernel pmap invalidation, while we do not care at all for the user pmaps ? What if you always set anychanged if a pte was changed, and then at the end, near PMAP_UNLOCK(), do the pmap_invalidate_range() call if the var is true ?

Replying to myself, we must not invalidate unmapped ranges.

markj edited edge metadata.

Optimize i386 pmap_advise() as well.

This revision now requires review to proceed.Jan 10 2017, 4:29 AM
sys/amd64/amd64/pmap.c
6118

In fact, returning to the merge of kernel_pmap and !kernel_pmap cases. After you added exact range invalidation, we still can remove anychanged and checks for PG_G. Always do range invalidation, regardless of the kernel/user pmap.

sys/amd64/amd64/pmap.c
6118

I think that we should consider this issue separately. Right now, this revision follows the same approach as pmap_protect() and pmap_remove().

To be clear, I think that we should reconsider our utilization of range invalidations, or really lack thereof, on user-space pmaps. Things have changed, e.g., TLBs have gotten larger and we have made pmap_invalidate_all() work on the kernel pmap.

kib edited edge metadata.
kib added inline comments.
sys/amd64/amd64/pmap.c
6118

I do not object.

Do you mean, by the second paragraph of your reply, that we should start doing range invalidations, or that instead, kernel range invalidations converted to _all() ?

This revision is now accepted and ready to land.Jan 10 2017, 4:15 PM
sys/amd64/amd64/pmap.c
6118

Some of both.

This revision was automatically updated to reflect the committed changes.