Date: Thu, 19 Nov 2020 15:40:59 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367844 - head/sys/vm Message-ID: <202011191540.0AJFexN0048763@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Thu Nov 19 15:40:58 2020 New Revision: 367844 URL: https://svnweb.freebsd.org/changeset/base/367844 Log: Micro-optimize vm_page_pqbatch_submit() Avoid calling vm_page_domain() twice. Discussed with: alc (in D27207) Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Nov 19 14:27:01 2020 (r367843) +++ head/sys/vm/vm_page.c Thu Nov 19 15:40:58 2020 (r367844) @@ -3598,8 +3598,6 @@ vm_page_pqbatch_submit(vm_page_t m, uint8_t queue) KASSERT(queue < PQ_COUNT, ("invalid queue %d", queue)); domain = vm_page_domain(m); - pq = &vm_pagequeue_domain(m)->vmd_pagequeues[queue]; - critical_enter(); bq = DPCPU_PTR(pqbatch[domain][queue]); if (vm_batchqueue_insert(bq, m)) { @@ -3607,6 +3605,8 @@ vm_page_pqbatch_submit(vm_page_t m, uint8_t queue) return; } critical_exit(); + + pq = &VM_DOMAIN(domain)->vmd_pagequeues[queue]; vm_pagequeue_lock(pq); critical_enter(); bq = DPCPU_PTR(pqbatch[domain][queue]);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202011191540.0AJFexN0048763>