Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Feb 2021 01:31:35 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org
Subject:   git: 678abec026af - releng/13.0 - vm: Honour the "noreuse" flag to vm_page_unwire_managed()
Message-ID:  <202102130131.11D1VZRI090217@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch releng/13.0 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=678abec026afb72ebb39ab9bda121b9afb85f8f6

commit 678abec026afb72ebb39ab9bda121b9afb85f8f6
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2021-02-10 16:10:27 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2021-02-13 01:31:22 +0000

    vm: Honour the "noreuse" flag to vm_page_unwire_managed()
    
    This flag indicates that the page should be enqueued near the head of
    the inactive queue, skipping the LRU queue.  It is used when unwiring
    pages from the buffer cache following direct I/O or after I/O when
    POSIX_FADV_NOREUSE or _DONTNEED advice was specified, or when
    sendfile(SF_NOCACHE) completes.  For the direct I/O and sendfile cases
    we only enqueue the page if we decide not to free it, typically because
    it's mapped.
    
    Pass "noreuse" through to vm_page_release_toq() so that we actually
    honour the desired LRU policy for these scenarios.
    
    Approved by:    re (kib)
    Reported by:    bdrewery
    Reviewed by:    alc, kib
    Differential Revision:  https://reviews.freebsd.org/D28555
    
    (cherry picked from commit 5c18744ea9b94cb6a9a091a900fa4999868736e1)
    (cherry picked from commit a73aaaeb579bc7454621c4389636a6d4a952d58c)
---
 sys/vm/vm_page.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index e668bbdc6178..c36b8cdc5762 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -3989,7 +3989,7 @@ vm_page_unwire_managed(vm_page_t m, uint8_t nqueue, bool noreuse)
 			 * (i.e., the VPRC_OBJREF bit is clear), we only need to
 			 * clear leftover queue state.
 			 */
-			vm_page_release_toq(m, nqueue, false);
+			vm_page_release_toq(m, nqueue, noreuse);
 		} else if (old == 1) {
 			vm_page_aflag_clear(m, PGA_DEQUEUE);
 		}



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