Page MenuHomeFreeBSD

vm: Remove kernel stack swapping support, part 7
ClosedPublic

Authored by markj on Jul 24 2024, 9:39 PM.
Tags
None
Referenced Files
F102761419: D46118.diff
Sat, Nov 16, 7:37 PM
Unknown Object (File)
Sun, Nov 3, 7:14 PM
Unknown Object (File)
Oct 8 2024, 5:38 PM
Unknown Object (File)
Sep 30 2024, 5:35 PM
Unknown Object (File)
Sep 27 2024, 10:52 PM
Unknown Object (File)
Sep 22 2024, 11:11 PM
Unknown Object (File)
Sep 8 2024, 9:35 AM
Unknown Object (File)
Sep 7 2024, 9:12 PM

Details

Summary

Remove some uses of PHOLD which were there only to prevent the process'
threads from being swapped out.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Jul 24 2024, 9:39 PM
sys/dev/nvme/nvme_ctrlr.c
1266

Why isn't this needed? The user buffer is in the user's process, and almost never on the kernel stack.

markj added inline comments.
sys/dev/nvme/nvme_ctrlr.c
1266

I'm not sure why it was needed even before. The current process won't exit while this thread is sleeping below.

Any idea how to test this?
Will something else killing, eg, camcontrol which has issued the command before the I/O is complete be a good test?
I guess I'm nervous for reasons that maybe are completly irrational and looking for some way to test this...

sys/dev/nvme/nvme_ctrlr.c
1266

Yea, I've never gone and seen why it's needed, only to have people comment on it when I didn't do it elsewhere...
But maybe it was part of the cargo-cult and/or battle scars from the memory starved era where a process's stack could get swapped out while the I/O was pending...
Re-reading the PHOLD and related code suggests that this is fine... I didn't see any of the other side effects I assumed would happen...

This revision is now accepted and ready to land.Jul 24 2024, 10:18 PM
In D46118#1051156, @imp wrote:

Any idea how to test this?
Will something else killing, eg, camcontrol which has issued the command before the I/O is complete be a good test?
I guess I'm nervous for reasons that maybe are completly irrational and looking for some way to test this...

I will ask Peter to run stress2. I don't know of any good way to specifically test this change.