git: 9c975a0d90f1 - main - pbuf_ctor(): Stop using LK_NOWAIT, use LK_NOWITNESS

From: Ryan Libby <rlibby_at_FreeBSD.org>
Date: Sun, 26 May 2024 17:36:52 UTC
The branch main has been updated by rlibby:

URL: https://cgit.FreeBSD.org/src/commit/?id=9c975a0d90f1ee5259e53bebb48f9d7a5c2dd376

commit 9c975a0d90f1ee5259e53bebb48f9d7a5c2dd376
Author:     Ryan Libby <rlibby@FreeBSD.org>
AuthorDate: 2024-05-26 17:20:52 +0000
Commit:     Ryan Libby <rlibby@FreeBSD.org>
CommitDate: 2024-05-26 17:20:52 +0000

    pbuf_ctor(): Stop using LK_NOWAIT, use LK_NOWITNESS
    
    The LK_NOWAIT was added to suppress a witness warning, but LK_NOWITNESS
    is more what we mean.  This makes pbuf_ctor() more consistent with
    buf_alloc(), although, unlike buf_alloc(), for pbuf there should not be
    any danger of a wild locker relying on the type stability of the buf to
    attempt a lock.  That is, this is essentially cosmetic.
    
    Relevant history:
     - 531f8cfea06b Use dedicated lock name for pbufs
     - 5875b94c7493 buf_alloc(): lock the buffer with LK_NOWAIT
     - c9e023541aef pbuf_ctor(): lock the buffer with LK_NOWAIT
     - 1fb00c8f1060 buf_alloc(): Stop using LK_NOWAIT, use LK_NOWITNESS
    
    Reviewed by:    rew, kib
    Sponsored by:   Dell EMC Isilon
    Differential Revision:  https://reviews.freebsd.org/D45360
---
 sys/vm/vm_pager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c
index 3550d5a6fac1..4da046ece50c 100644
--- a/sys/vm/vm_pager.c
+++ b/sys/vm/vm_pager.c
@@ -470,7 +470,7 @@ pbuf_ctor(void *mem, int size, void *arg, int flags)
 	bp->b_ioflags = 0;
 	bp->b_iodone = NULL;
 	bp->b_error = 0;
-	BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL);
+	BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWITNESS, NULL);
 
 	return (0);
 }