Page MenuHomeFreeBSD

Remove swblk_t.
ClosedPublic

Authored by markj on Feb 13 2020, 5:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 24, 1:45 AM
Unknown Object (File)
Sat, Apr 13, 7:56 PM
Unknown Object (File)
Fri, Apr 12, 9:12 AM
Unknown Object (File)
Mar 22 2024, 10:22 PM
Unknown Object (File)
Mar 22 2024, 10:22 PM
Unknown Object (File)
Mar 22 2024, 10:22 PM
Unknown Object (File)
Mar 8 2024, 8:38 AM
Unknown Object (File)
Jan 19 2024, 4:06 PM
Subscribers

Details

Summary

It was used only to store the bounds of each swap device. However,
since swblk_t is a signed 32-bit int and daddr_t is a signed 64-bit
int, swp_pager_isondev() may return an invalid result if swap devices
are repeatedly added and removed and sw_end for a device ends up
becoming a negative number.

Note that the removed comment about maximum swap size still applies.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Feb 13 2020, 11:04 PM

This change probably can't be MFCed. We could fix the problem in a different way, by changing swaponsomething() to allocate block ranges more carefully. The current algorithm just scans the list of existing swap devices and places the new one after the end of the last one. I think I will just commit the change and make the block range allocation smarter in a follow-up change.

This change probably can't be MFCed.

Why ?

We could fix the problem in a different way, by changing swaponsomething() to allocate block ranges more carefully. The current algorithm just scans the list of existing swap devices and places the new one after the end of the last one. I think I will just commit the change and make the block range allocation smarter in a follow-up change.

swdevt is kernel-internal, more it is sys/vm internal. The external userspace view on it is provided by struct xswdev.

In D23666#519989, @kib wrote:

This change probably can't be MFCed.

Why ?

We could fix the problem in a different way, by changing swaponsomething() to allocate block ranges more carefully. The current algorithm just scans the list of existing swap devices and places the new one after the end of the last one. I think I will just commit the change and make the block range allocation smarter in a follow-up change.

swdevt is kernel-internal, more it is sys/vm internal. The external userspace view on it is provided by struct xswdev.

I was worried that removal of swblk_t would cause some out-of-tree code to fail to compile (e.g. because of copy-and-paste of libkvm code). Maybe this is still acceptable for the stable branches, I am not sure. I will add a MFC marker and wait for any reported fallout from ports.

This revision was automatically updated to reflect the committed changes.