> Date: Tue, 26 Apr 2022 14:19:32 +0200
> From: Martin Pieuchot <m...@openbsd.org>
> 
> I'd like to use a proper interface to add/remove pages on the
> active/inactive queues.  This will help for lock assertions and help
> improving the existing LRU limitations.
> 
> Diff below makes uvm_pageunwire() call uvm_pageactivate() instead of
> inserting the page itself.
> 
> ok?

Yes, I don't think it is worth to optimize this.

> Index: uvm/uvm_page.c
> ===================================================================
> RCS file: /cvs/src/sys/uvm/uvm_page.c,v
> retrieving revision 1.163
> diff -u -p -r1.163 uvm_page.c
> --- uvm/uvm_page.c    12 Mar 2022 12:34:22 -0000      1.163
> +++ uvm/uvm_page.c    26 Apr 2022 12:13:59 -0000
> @@ -1279,9 +1279,7 @@ uvm_pageunwire(struct vm_page *pg)
>  
>       pg->wire_count--;
>       if (pg->wire_count == 0) {
> -             TAILQ_INSERT_TAIL(&uvm.page_active, pg, pageq);
> -             uvmexp.active++;
> -             atomic_setbits_int(&pg->pg_flags, PQ_ACTIVE);
> +             uvm_pageactivate(pg);
>               uvmexp.wired--;
>       }
>  }
> 
> 

Reply via email to