Date: Wed, 6 Feb 2019 18:43:30 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r343841 - stable/12/sys/vm Message-ID: <201902061843.x16IhUGM024185@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Wed Feb 6 18:43:30 2019 New Revision: 343841 URL: https://svnweb.freebsd.org/changeset/base/343841 Log: MFC r343719: Fix a race in vm_page_dequeue_deferred(). Modified: stable/12/sys/vm/vm_page.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vm_page.c ============================================================================== --- stable/12/sys/vm/vm_page.c Wed Feb 6 18:02:43 2019 (r343840) +++ stable/12/sys/vm/vm_page.c Wed Feb 6 18:43:30 2019 (r343841) @@ -3275,18 +3275,13 @@ vm_page_dequeue_complete(vm_page_t m) void vm_page_dequeue_deferred(vm_page_t m) { - int queue; + uint8_t queue; vm_page_assert_locked(m); - queue = atomic_load_8(&m->queue); - if (queue == PQ_NONE) { - KASSERT((m->aflags & PGA_QUEUE_STATE_MASK) == 0, - ("page %p has queue state", m)); + if ((queue = vm_page_queue(m)) == PQ_NONE) return; - } - if ((m->aflags & PGA_DEQUEUE) == 0) - vm_page_aflag_set(m, PGA_DEQUEUE); + vm_page_aflag_set(m, PGA_DEQUEUE); vm_pqbatch_submit_page(m, queue); } @@ -3382,7 +3377,7 @@ vm_page_requeue(vm_page_t m) { vm_page_assert_locked(m); - KASSERT(m->queue != PQ_NONE, + KASSERT(vm_page_queue(m) != PQ_NONE, ("%s: page %p is not logically enqueued", __func__, m)); if ((m->aflags & PGA_REQUEUE) == 0)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201902061843.x16IhUGM024185>