uvm_pagealloc() & uvm.free accounting

2020-11-13 Thread Martin Pieuchot
The uvmexp.free* variables are read in uvm_pagealloc() & uvm_pglistalloc() before grabbing the `fpageqlock'. `uvmexp.free' is always modified by the pmemrange allocator under the above motioned lock. To avoid races and the chances of missing a wakeup, the diff below move the checks inside the cri

Re: uvm_pagealloc() & uvm.free accounting

2020-11-13 Thread Mark Kettenis
> Date: Fri, 13 Nov 2020 11:38:33 -0300 > From: Martin Pieuchot > > The uvmexp.free* variables are read in uvm_pagealloc() & uvm_pglistalloc() > before grabbing the `fpageqlock'. > > `uvmexp.free' is always modified by the pmemrange allocator under the > above motioned lock. To avoid races and

Re: uvm_pagealloc() & uvm.free accounting

2020-11-16 Thread Martin Pieuchot
On 13/11/20(Fri) 21:05, Mark Kettenis wrote: > [...] > > Careful reviewers will spot an off-by-one change in the check for > > pagedaemon's reserved memory. My understanding is that it's a bugfix, > > is it correct? > > You mean for uvm_pagealloc(). I'd say yes. But this does mean that > in s

Re: uvm_pagealloc() & uvm.free accounting

2020-11-17 Thread Mark Kettenis
> Date: Mon, 16 Nov 2020 10:11:50 -0300 > From: Martin Pieuchot > > On 13/11/20(Fri) 21:05, Mark Kettenis wrote: > > [...] > > > Careful reviewers will spot an off-by-one change in the check for > > > pagedaemon's reserved memory. My understanding is that it's a bugfix, > > > is it correct? >

Re: uvm_pagealloc() & uvm.free accounting

2020-11-17 Thread Martin Pieuchot
On 17/11/20(Tue) 13:23, Mark Kettenis wrote: > > Date: Mon, 16 Nov 2020 10:11:50 -0300 > > From: Martin Pieuchot > > > > On 13/11/20(Fri) 21:05, Mark Kettenis wrote: > > > [...] > > > > Careful reviewers will spot an off-by-one change in the check for > > > > pagedaemon's reserved memory. My u

Re: uvm_pagealloc() & uvm.free accounting

2020-11-17 Thread Mark Kettenis
> Date: Tue, 17 Nov 2020 09:32:28 -0300 > From: Martin Pieuchot > > On 17/11/20(Tue) 13:23, Mark Kettenis wrote: > > > Date: Mon, 16 Nov 2020 10:11:50 -0300 > > > From: Martin Pieuchot > > > > > > On 13/11/20(Fri) 21:05, Mark Kettenis wrote: > > > > [...] > > > > > Careful reviewers will spot

Re: uvm_pagealloc() & uvm.free accounting

2020-11-17 Thread Martin Pieuchot
On 17/11/20(Tue) 13:52, Mark Kettenis wrote: > > Date: Tue, 17 Nov 2020 09:32:28 -0300 > > From: Martin Pieuchot > > > > On 17/11/20(Tue) 13:23, Mark Kettenis wrote: > > > > Date: Mon, 16 Nov 2020 10:11:50 -0300 > > > > From: Martin Pieuchot > > > > > > > > On 13/11/20(Fri) 21:05, Mark Kettenis