Re: An idea for swap partition size vs. swap space size in use handling
- In reply to: Ronald Klop : "Re: An idea for swap partition size vs. swap space size in use handling"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 22 Jan 2023 18:20:32 UTC
On Jan 22, 2023, at 06:11, Ronald Klop <ronald-lists@klop.ws> wrote: > > > Van: Mark Millard <marklmi@yahoo.com> > Datum: zondag, 22 januari 2023 05:41 > Aan: freebsd-current <freebsd-current@freebsd.org> > Onderwerp: An idea for swap partition size vs. swap space size in use handling > I have boot media that are each set up to boot a variety > of systems that have widely different RAM sizes, from > 1 GiBytes to 64 GiBytes for the aarch64 examples of this. > > This has lead to having multiple swap partitions of > various sizes so that I can have total swap spaces that > are somewhat under the recommended maximum sizes for the > amount of RAM in each of those systems that a given media > can boot. > > It would be nice if I could have just one swap partition > on a given boot media, one that is more than sufficient > in size for all but the biggest RAM system --but to then > be able to tell the system to just use up to the > recommended swap space size and to ignore any extra swap > space in the swap partition. > > If such could be done, I'd no longer use multiple swap > partitions at the same time in order to get to a desired > total for the system at hand at the time. > > Of course, that still leaves what to do when multiple > swap partitions are enabled if such a "ignore what > would be extra" mode was also enabled. As I'd not use > such, I've no specific recommendations to make that > would make any difference to my use. > > === > Mark Millard > marklmi at yahoo.com > > Â > > > Hi Mark, > > Do you mean you would like to be able to add a "size" parameter to the fstab swap line? > > /dev/da0p1 none swap sw,size=1g 0 0 No. That would use 1g for even the 64 GiByte RAM system when I move the media to that 64 GiByte system and boot it --and similarly as I move the media from system to system in general. For my style of use, I want the swap to be (a lower bound approximation of) the recommended figure for the amount of RAM for the specific system the media is currently use in. That means that the figure changes when I move the media to a system with a different amount of RAM. > Another option I can think of is using the "gnop" geom provider. It has a -s parameter to set the size. I classically use a label based path to identify the swap partition, not a device name. This fits with the variations in what system I'm booting and what other devices might be around. (Some of the media involved here are USB media.) Labels go at the end of partitions, as I remember. This would appear to make forms of resizing or subranging the partition also mean adjusting the labeling. That is something I'd like to avoid. I'd also like to avoid needing to provide my own lower bound approximation of the recommended figure for the live amount of RAM. For one, it is platform dependent, for example armv7 and aarch64 are very different for the same amount of RAM. === Mark Millard marklmi at yahoo.com