Date: Sun, 19 May 2019 17:40:30 +0100 From: RW <rwmaillists@googlemail.com> To: freebsd-hackers@freebsd.org Subject: Re: total configured swap exceeds maximum Message-ID: <20190519174030.0206eb41@gumby.homeunix.com> In-Reply-To: <18598E43-CFB1-4C3C-BC46-A4F0DEB569CF@yahoo.com> References: <alpine.BSF.2.20.1905191204540.4805@puchar.net> <20190519160033.0b0e47fa@gumby.homeunix.com> <alpine.BSF.2.20.1905191733230.61441@puchar.net> <18598E43-CFB1-4C3C-BC46-A4F0DEB569CF@yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 19 May 2019 08:53:15 -0700 Mark Millard wrote: > On 2019-May-19, at 08:33, Wojciech Puchar <wojtek@puchar.net> wrote: > > >>> what should i set kern.maxswzone to ? it is 0 > >>> > >>> # sysctl kern.maxswzone > >>> kern.maxswzone: 0 > >> > >> IIRC for amd64 kern.maxswzone=0 represents the maximum allowed. > > so i cannot have more VM than 5*RAM? > > There is is a kernel memory tradeoff structure to increase in > kern.maxswzone being larger as I understand. Quoting "man 8 loader" > (but the "eight times" is system/architecture specific and will > likely be different): > > kern.maxswzone > Limits the amount of KVM to be used to hold swap > metadata, which directly governs the maximum amount of swap the > system can support, at the rate of approximately 200 > MB of swap space per 1 MB of metadata. This value is specified > in bytes of KVA space. If no value is provided, the > system allocates enough memory to handle an amount of swap that > corresponds to eight times the amount of physical > memory present in the system. In swap_pager.c /* * Initialize our zone, guessing on the number we need based * on the number of pages in the system. */ n = vm_cnt.v_page_count / 2; if (maxswzone && n > maxswzone / sizeof(struct swblk)) n = maxswzone / sizeof(struct swblk); In i386 maxswzone defaults to a specific value and it is possible to increase the size. In amd64 maxswzone defaults to 0 which give the highest value of n permitted.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190519174030.0206eb41>