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
Unknown Object (File)
Fri, Nov 29, 12:49 AM
Unknown Object (File)
Mon, Nov 25, 4:25 AM
Unknown Object (File)
Mon, Nov 18, 4:00 PM
Unknown Object (File)
Mon, Nov 18, 12:55 PM
Unknown Object (File)
Mon, Nov 18, 12:35 PM
Unknown Object (File)
Mon, Nov 18, 12:17 PM
Unknown Object (File)
Mon, Nov 18, 11:44 AM
Unknown Object (File)
Nov 16 2024, 10:47 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.