Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Apr 2022 11:12:29 +0200
From:      =?UTF-8?B?VMSzbA==?= Coosemans <tijl@FreeBSD.org>
To:        Michael Wayne <freebsd07@wayne47.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Can not build kernel on 1GB VM *Solved*
Message-ID:  <20220420111229.36de494f@FreeBSD.org>
In-Reply-To: <20220418173333.GC72471@post.wayne47.com>
References:  <20220415174953.GE13678@post.wayne47.com> <20220418173333.GC72471@post.wayne47.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--MP_/=QnV_61ajZ/4x58KPu69/l8
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Mon, 18 Apr 2022 13:33:33 -0400 Michael Wayne <freebsd07@wayne47.com>
wrote:
> On Fri, Apr 15, 2022 at 01:49:53PM -0400, Michael Wayne wrote:
>> I have a VM with 1GB RAM running FreeBSD 12.1-RELEASE-p3
>> 
>> I'm trying to upgrade the machine to 12.3 and having swap failures.  
> 
> I tried a number of things, all of which failed.
> 
> Since the offending line is:
> 
>>    ctfmerge -L VERSION -g -o kernel.full ...  
> 
> I went digging through makefiles and found:
>    MK_CTF=no
> 
> Adding this to the command line permitted the build to complete and
> the machine is now running on the new kernel. Hopefully this helps
> others. I'm still not sure why the kernel refused to use swap but 
> this is a very easy to duplicate issue.

How many CPU cores does the VM have?

Can you still reproduce it now that you run 12.3?

If so, can you try the attached patch?  It prevents background
laundering when nfreed == 0, restoring some behaviour from before
https://cgit.freebsd.org/src/commit/?id=c098768e4dad and
https://cgit.freebsd.org/src/commit/?id=60684862588f.

--MP_/=QnV_61ajZ/4x58KPu69/l8
Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=vm_pageout_worker.patch

diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index 36d5f3275800..df827af3075f 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -1069,7 +1069,7 @@ vm_pageout_laundry_worker(void *arg)
 		nclean = vmd->vmd_free_count +
 		    vmd->vmd_pagequeues[PQ_INACTIVE].pq_cnt;
 		ndirty = vmd->vmd_pagequeues[PQ_LAUNDRY].pq_cnt;
-		if (target == 0 && ndirty * isqrt(howmany(nfreed + 1,
+		if (target == 0 && ndirty * isqrt(howmany(nfreed,
 		    vmd->vmd_free_target - vmd->vmd_free_min)) >= nclean) {
 			target = vmd->vmd_background_launder_target;
 		}

--MP_/=QnV_61ajZ/4x58KPu69/l8--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20220420111229.36de494f>