Page MenuHomeFreeBSD

sys/vm: remove support for growing-up stacks
ClosedPublic

Authored by kib on Dec 3 2024, 11:33 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jan 24, 12:37 PM
Unknown Object (File)
Fri, Jan 10, 5:35 AM
Unknown Object (File)
Jan 4 2025, 8:33 AM
Unknown Object (File)
Jan 4 2025, 8:30 AM
Unknown Object (File)
Jan 2 2025, 11:31 AM
Unknown Object (File)
Dec 29 2024, 12:54 AM
Unknown Object (File)
Dec 27 2024, 11:04 AM
Unknown Object (File)
Dec 26 2024, 10:18 AM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kib requested review of this revision.Dec 3 2024, 11:33 PM
sys/vm/vm_map.c
4626–4627

This comment needs to be simplified.

sys/vm/vm_map.h
147–148

Remove the _DN suffix?

383–384

Remove the _DN suffix?

kib marked 3 inline comments as done.

Reword comment.
Drop _DN suffixes, a separate commit.

sys/vm/vm_map.h
378–379

Remove the _DOWN suffix?

sys/vm/vm_map.h
378–379

Could you please propose the complete name for the flag?

sys/vm/vm_map.h
378–379

MAP_STACK seems natural but I suppose that would collide with mman.h.

MAP_STACK_REGION?

sys/vm/vm_map.h
378–379

Hmm, prior to rGb21a0008bac990d201c41aabefccd3eddaeaaae3 we didn't have either of these flags at all. Can we just remove it entirely? We already require it unconditionally for vm_map_growstack?

sys/vm/vm_map.h
378–379

No, not unconditionally. We detect the growable stack in vm_map_growstack() by presence of the gap-less pair of vm_map_entries, which should be guard on left, and MAP_STACK_GROWS_DOWN on right. Otherwise vm_map_growstack() bails out and does not extend.

This description makes me think that the name might be fine as is. I only was able to construct MAP_MAPPED_STACK_AREA name, if anybody likes it.

sys/vm/vm_map.h
378–379

Might be MAP_ENTRY_STACK_MAPPED_AREA, for symmetry with MAP_ENTRY_STACK_GAP ?

Remove MAP_ENTRY_GROWS_UP

Rename MAP_STACK_GROWS_DOWN to MAP_STACK_AREA

sys/kern/kern_proc.c
2698

It seems that no one ever sets the KVME_FLAG_GROWS_UP bit anymore, so that it can disappear and KVME_FLAG_GROWS_DOWN can drop the _DOWN.

2699

We can drop the _DOWN from MAP_ENTRY_GROWS_DOWN

sys/vm/vm_map.h
98

This comment is stale.

kib marked 2 inline comments as done.Dec 5 2024, 4:42 AM
kib added inline comments.
sys/kern/kern_proc.c
2698

KVME_ flags form userspace API and ABI, we cannot change them, and must keep them even if no longer used.

2699

But it still correctly describes the entry main feature. If you insist, I will come with some other name, but IMO this one is expressive.

kib marked an inline comment as done.

Update comment about permissions for stack gap entries.

This revision is now accepted and ready to land.Dec 5 2024, 7:14 AM
sys/vm/vm_map.c
4598–4599

Since the variable orient no longer exists, this comment should be deleted.

4599–4600
sys/vm/vm_map.h
97–99
kib marked 7 inline comments as done.

Alan' notes. Remove outdated comment. Fix kassert message.

This revision now requires review to proceed.Dec 5 2024, 10:28 PM
This revision is now accepted and ready to land.Dec 6 2024, 7:08 AM