From nobody Mon Mar 13 11:00:47 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PZtxC6KPXz3xYF8; Mon, 13 Mar 2023 11:00:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PZtxC5mhxz3R1B; Mon, 13 Mar 2023 11:00:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678705247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=olstvcGd94np97MGpjdzRUJh2Xud9BY9eTpNzHGy5Xs=; b=LZWtXImd5oVP18e4txO5DDrBnx7ygnqOFoDTizCKVNLw4Y67WjYEDCmd5yFdheDbgPeSuw Dr4b0sXzEOMYcmmdh4Ix1RS2IiAHJbFYltYjzaY61eipsNoBUIH7oEVaHaXHKyd/ExxyCd KQ4mL7k0ccXHlXgB9crylYddOxHb7KdCD1GEtYQ+rFun4P+IzyWf1a18jP9H6oxttT4jWq u+PZBQWrXbYSUsdbgazmn4ZvSOnCKdKB8dzNY7HuLh3b7K5G4Gdapmg/9ov4kGqIIY4fBp ioPOj45OqEAl8M1tnksP0uIWY8BkPFTrg0Vys6gWd9GX5pVDWEBFXnHn98rBKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678705247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=olstvcGd94np97MGpjdzRUJh2Xud9BY9eTpNzHGy5Xs=; b=XXXzOk6TPtamYLFEHnrTxvKcyui0/GvqVF8LzRTOwrJYt8WLLGE9hbMeadTlHjZ7OijE0H oZZl4VTzJMasr4jo2ThgAdyGcbWOf2s6Ll+Zf6Nz/9TZn8SF3YNTY0HaNZBVnwPn6DinTs SvhFOdNYm9N3N0x5Ukj1EeAwCFgquPTpx2c9DigfnEtgFEuByj7y2QIMgW5M6u8mDX0slg XFzJziKwOOvW6VY/T44jE0xGzP4jeWcuCrauzZzu6qNH8bB044K+KpYRdkms+7QJayHAhC 6O8BXrOw1hcuaixK0kTiETzuz6GpRhqp9XcaYlOhsKO8ap5Yx8gqf3HKbcaCZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678705247; a=rsa-sha256; cv=none; b=v/0LYpRog5P4L8q8VBfT3vXEMyy8PAjBvWqSubbHRF7EC9BmySrvxcyucUYVDfcw1k+Oki Ik/yoxA9weH5w741QzVqAQsPD/IZiR3wezJE08QRKR2h3C2Cr7ninTxch82Det83CvUgzP niVCbnNolc4N/7Wf6ww9ZIwDN0i8yA1HRU0eyGlTBcpMVkUgcQ/+d0taAm7U30Fs/q11MX T+7HJqIjzwKd8XZz9qNlQJnEITLQP3TP8Nw98YRcM8JAgTcsMtEYLzFI7GLOTYxfQrSOkz +p8z22MiYePelMYivnP/cw9GOJAVxo4D5MV5eCVobOnLtzgwNe88UgshDRR2fg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PZtxC4rGMzqwg; Mon, 13 Mar 2023 11:00:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32DB0lZ6059022; Mon, 13 Mar 2023 11:00:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32DB0l2h059021; Mon, 13 Mar 2023 11:00:47 GMT (envelope-from git) Date: Mon, 13 Mar 2023 11:00:47 GMT Message-Id: <202303131100.32DB0l2h059021@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 0a310c94eeb8 - main - vm: consistently prefix fault helpers with vm_fault_ List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a310c94eeb8ffae1d96d1797d2b2e6cad8e5afe Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=0a310c94eeb8ffae1d96d1797d2b2e6cad8e5afe commit 0a310c94eeb8ffae1d96d1797d2b2e6cad8e5afe Author: Mateusz Guzik AuthorDate: 2023-03-12 18:38:29 +0000 Commit: Mateusz Guzik CommitDate: 2023-03-13 11:00:28 +0000 vm: consistently prefix fault helpers with vm_fault_ Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D39029 --- sys/vm/vm_fault.c | 80 +++++++++++++++++++++++++++---------------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index fadd7dbd2fd5..056e6e12e8c8 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -195,7 +195,7 @@ SYSCTL_INT(_vm, OID_AUTO, pfault_oom_wait, CTLFLAG_RWTUN, "the page fault handler"); static inline void -fault_page_release(vm_page_t *mp) +vm_fault_page_release(vm_page_t *mp) { vm_page_t m; @@ -213,7 +213,7 @@ fault_page_release(vm_page_t *mp) } static inline void -fault_page_free(vm_page_t *mp) +vm_fault_page_free(vm_page_t *mp) { vm_page_t m; @@ -235,7 +235,7 @@ fault_page_free(vm_page_t *mp) * be checked quickly. */ static inline bool -fault_object_needs_getpages(vm_object_t object) +vm_fault_object_needs_getpages(vm_object_t object) { VM_OBJECT_ASSERT_LOCKED(object); @@ -244,7 +244,7 @@ fault_object_needs_getpages(vm_object_t object) } static inline void -unlock_map(struct faultstate *fs) +vm_fault_unlock_map(struct faultstate *fs) { if (fs->lookup_still_valid) { @@ -254,7 +254,7 @@ unlock_map(struct faultstate *fs) } static void -unlock_vp(struct faultstate *fs) +vm_fault_unlock_vp(struct faultstate *fs) { if (fs->vp != NULL) { @@ -264,29 +264,29 @@ unlock_vp(struct faultstate *fs) } static void -fault_deallocate(struct faultstate *fs) +vm_fault_deallocate(struct faultstate *fs) { - fault_page_release(&fs->m_cow); - fault_page_release(&fs->m); + vm_fault_page_release(&fs->m_cow); + vm_fault_page_release(&fs->m); vm_object_pip_wakeup(fs->object); if (fs->object != fs->first_object) { VM_OBJECT_WLOCK(fs->first_object); - fault_page_free(&fs->first_m); + vm_fault_page_free(&fs->first_m); VM_OBJECT_WUNLOCK(fs->first_object); vm_object_pip_wakeup(fs->first_object); } vm_object_deallocate(fs->first_object); - unlock_map(fs); - unlock_vp(fs); + vm_fault_unlock_map(fs); + vm_fault_unlock_vp(fs); } static void -unlock_and_deallocate(struct faultstate *fs) +vm_fault_unlock_and_deallocate(struct faultstate *fs) { VM_OBJECT_UNLOCK(fs->object); - fault_deallocate(fs); + vm_fault_deallocate(fs); } static void @@ -471,8 +471,8 @@ vm_fault_populate(struct faultstate *fs) pager_first = OFF_TO_IDX(fs->entry->offset); pager_last = pager_first + atop(fs->entry->end - fs->entry->start) - 1; - unlock_map(fs); - unlock_vp(fs); + vm_fault_unlock_map(fs); + vm_fault_unlock_vp(fs); res = FAULT_SUCCESS; @@ -781,7 +781,7 @@ vm_fault_lock_vnode(struct faultstate *fs, bool objlocked) * Perform an unlock in case the desired vnode changed while * the map was unlocked during a retry. */ - unlock_vp(fs); + vm_fault_unlock_vp(fs); locked = VOP_ISLOCKED(vp); if (locked != LK_EXCLUSIVE) @@ -801,9 +801,9 @@ vm_fault_lock_vnode(struct faultstate *fs, bool objlocked) vhold(vp); if (objlocked) - unlock_and_deallocate(fs); + vm_fault_unlock_and_deallocate(fs); else - fault_deallocate(fs); + vm_fault_deallocate(fs); error = vget(vp, locked | LK_RETRY | LK_CANRECURSE); vdrop(vp); fs->vp = vp; @@ -875,7 +875,7 @@ vm_fault_lookup(struct faultstate *fs) VM_PROT_FAULT_LOOKUP, &fs->entry, &fs->first_object, &fs->first_pindex, &fs->prot, &fs->wired); if (result != KERN_SUCCESS) { - unlock_vp(fs); + vm_fault_unlock_vp(fs); return (result); } @@ -892,7 +892,7 @@ vm_fault_lookup(struct faultstate *fs) vm_map_lock(fs->map); if (vm_map_lookup_entry(fs->map, fs->vaddr, &fs->entry) && (fs->entry->eflags & MAP_ENTRY_IN_TRANSITION)) { - unlock_vp(fs); + vm_fault_unlock_vp(fs); fs->entry->eflags |= MAP_ENTRY_NEEDS_WAKEUP; vm_map_unlock_and_wait(fs->map, 0); } else @@ -1095,10 +1095,10 @@ vm_fault_next(struct faultstate *fs) } else if (fs->m != NULL) { if (!vm_fault_object_ensure_wlocked(fs)) { fs->can_read_lock = false; - unlock_and_deallocate(fs); + vm_fault_unlock_and_deallocate(fs); return (FAULT_NEXT_RESTART); } - fault_page_free(&fs->m); + vm_fault_page_free(&fs->m); } /* @@ -1163,7 +1163,7 @@ vm_fault_allocate_oom(struct faultstate *fs) { struct timeval now; - unlock_and_deallocate(fs); + vm_fault_unlock_and_deallocate(fs); if (vm_pfault_oom_attempts < 0) return (true); if (!fs->oom_started) { @@ -1203,7 +1203,7 @@ vm_fault_allocate(struct faultstate *fs) } if (fs->pindex >= fs->object->size) { - unlock_and_deallocate(fs); + vm_fault_unlock_and_deallocate(fs); return (FAULT_OUT_OF_BOUNDS); } @@ -1215,7 +1215,7 @@ vm_fault_allocate(struct faultstate *fs) case FAULT_SUCCESS: case FAULT_FAILURE: case FAULT_RESTART: - unlock_and_deallocate(fs); + vm_fault_unlock_and_deallocate(fs); return (res); case FAULT_CONTINUE: /* @@ -1248,7 +1248,7 @@ vm_fault_allocate(struct faultstate *fs) vm_object_color(fs->object, atop(fs->vaddr) - fs->pindex); #endif if (!vm_pager_can_alloc_page(fs->object, fs->pindex)) { - unlock_and_deallocate(fs); + vm_fault_unlock_and_deallocate(fs); return (FAULT_FAILURE); } fs->m = vm_page_alloc(fs->object, fs->pindex, @@ -1309,7 +1309,7 @@ vm_fault_getpages(struct faultstate *fs, int *behindp, int *aheadp) * a shadow, then an earlier iteration of this loop * may have already unlocked the map.) */ - unlock_map(fs); + vm_fault_unlock_map(fs); status = vm_fault_lock_vnode(fs, false); MPASS(status == FAULT_CONTINUE || status == FAULT_RESTART); @@ -1364,8 +1364,8 @@ vm_fault_getpages(struct faultstate *fs, int *behindp, int *aheadp) */ if (rv == VM_PAGER_ERROR || rv == VM_PAGER_BAD) { VM_OBJECT_WLOCK(fs->object); - fault_page_free(&fs->m); - unlock_and_deallocate(fs); + vm_fault_page_free(&fs->m); + vm_fault_unlock_and_deallocate(fs); return (FAULT_OUT_OF_BOUNDS); } KASSERT(rv == VM_PAGER_FAIL, @@ -1396,11 +1396,11 @@ vm_fault_busy_sleep(struct faultstate *fs) */ vm_page_aflag_set(fs->m, PGA_REFERENCED); if (fs->object != fs->first_object) { - fault_page_release(&fs->first_m); + vm_fault_page_release(&fs->first_m); vm_object_pip_wakeup(fs->first_object); } vm_object_pip_wakeup(fs->object); - unlock_map(fs); + vm_fault_unlock_map(fs); if (fs->m != vm_page_lookup(fs->object, fs->pindex) || !vm_page_busy_sleep(fs->m, "vmpfw", 0)) VM_OBJECT_UNLOCK(fs->object); @@ -1434,7 +1434,7 @@ vm_fault_object(struct faultstate *fs, int *behindp, int *aheadp) */ if ((fs->object->flags & OBJ_DEAD) != 0) { dead = fs->object->type == OBJT_DEAD; - unlock_and_deallocate(fs); + vm_fault_unlock_and_deallocate(fs); if (dead) return (FAULT_PROTECTION_FAILURE); pause("vmf_de", 1); @@ -1467,11 +1467,11 @@ vm_fault_object(struct faultstate *fs, int *behindp, int *aheadp) * or this is the beginning of the search, allocate a new * page. */ - if (fs->m == NULL && (fault_object_needs_getpages(fs->object) || + if (fs->m == NULL && (vm_fault_object_needs_getpages(fs->object) || fs->object == fs->first_object)) { if (!vm_fault_object_ensure_wlocked(fs)) { fs->can_read_lock = false; - unlock_and_deallocate(fs); + vm_fault_unlock_and_deallocate(fs); return (FAULT_RESTART); } res = vm_fault_allocate(fs); @@ -1484,7 +1484,7 @@ vm_fault_object(struct faultstate *fs, int *behindp, int *aheadp) * If not, skip to the next object without dropping the lock to * preserve atomicity of shadow faults. */ - if (fault_object_needs_getpages(fs->object)) { + if (vm_fault_object_needs_getpages(fs->object)) { /* * At this point, we have either allocated a new page * or found an existing page that is only partially @@ -1647,8 +1647,8 @@ RetryFault: MPASS(res_next == FAULT_NEXT_NOOBJ); if ((fs.fault_flags & VM_FAULT_NOFILL) != 0) { if (fs.first_object == fs.object) - fault_page_free(&fs.first_m); - unlock_and_deallocate(&fs); + vm_fault_page_free(&fs.first_m); + vm_fault_unlock_and_deallocate(&fs); return (KERN_OUT_OF_BOUNDS); } VM_OBJECT_UNLOCK(fs.object); @@ -1698,7 +1698,7 @@ found: if (!fs.lookup_still_valid) { rv = vm_fault_relookup(&fs); if (rv != KERN_SUCCESS) { - fault_deallocate(&fs); + vm_fault_deallocate(&fs); if (rv == KERN_RESTART) goto RetryFault; return (rv); @@ -1757,7 +1757,7 @@ found: /* * Unlock everything, and return */ - fault_deallocate(&fs); + vm_fault_deallocate(&fs); if (hardfault) { VM_CNT_INC(v_io_faults); curthread->td_ru.ru_majflt++; @@ -1909,7 +1909,7 @@ vm_fault_prefault(const struct faultstate *fs, vm_offset_t addra, if (!obj_locked) VM_OBJECT_RLOCK(lobject); while ((m = vm_page_lookup(lobject, pindex)) == NULL && - !fault_object_needs_getpages(lobject) && + !vm_fault_object_needs_getpages(lobject) && (backing_object = lobject->backing_object) != NULL) { KASSERT((lobject->backing_object_offset & PAGE_MASK) == 0, ("vm_fault_prefault: unaligned object offset"));