Page MenuHomeFreeBSD

swapoff: add one more variant of the syscall
ClosedPublic

Authored by kib on Dec 8 2021, 9:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 21, 7:49 AM
Unknown Object (File)
Mar 28 2024, 6:04 PM
Unknown Object (File)
Mar 11 2024, 6:46 AM
Unknown Object (File)
Mar 11 2024, 6:46 AM
Unknown Object (File)
Mar 11 2024, 6:46 AM
Unknown Object (File)
Mar 11 2024, 6:46 AM
Unknown Object (File)
Mar 11 2024, 6:46 AM
Unknown Object (File)
Mar 11 2024, 4:38 AM
Subscribers

Diff Detail

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

Event Timeline

kib requested review of this revision.Dec 8 2021, 9:29 PM

Thanks for working on a separate syscall.

sys/kern/syscalls.master
3304

I somewhat think we should add a swapoff2(2) rather than breaking the API. The old one could become a libc wrapper or just be left in place.

3307

I really don't think this expansion space is necessary or worthwhile.

If we must do it, please add a len argument like __specialfd.

kib marked 2 inline comments as done.Dec 8 2021, 10:11 PM
kib added inline comments.
sys/kern/syscalls.master
3304

I do not like it, the reason for things like accept4(2) was that the applications use the original function by large volume, and changing its prototype is not feasible. For swapoff(2), I do not see a benefit of requiring somebody use swapoff2() vs. adding a zero argument to the swapoff(2) line.

If there is any consumer of the syscall besides swapoff(8), at all.

3307

We have flags, which should allow to deterministically control content of *resv1. But ok, I removed this.

kib marked 2 inline comments as done.

Remove resv1.
Fix symver.

include/unistd.h
582 ↗(On Diff #99748)
lib/libc/include/compat.h
72 ↗(On Diff #99748)
lib/libc/sys/Symbol.map
263 ↗(On Diff #99748)

I wonder if _swapoff and __sys_swapoff be removed from FBSDprivate_1.0 along with this ABI break?

lib/libc/sys/swapon.2
46 ↗(On Diff #99748)

Need to remove reserved here and below.

kib marked 4 inline comments as done.Dec 9 2021, 12:29 AM
kib added inline comments.
lib/libc/sys/Symbol.map
263 ↗(On Diff #99748)

I think we need to decide globally what to do about private exports not used by base. Then we should either remove all of them, or keep whatever we collected so far there.

kib marked an inline comment as done.

This patch builds and works. Tested both with the freshly-built swapof(8) and with swapoff from 13.

Looks good. Thank you!

This revision is now accepted and ready to land.Dec 9 2021, 12:43 AM