From 9c975a0d90f1ee5259e53bebb48f9d7a5c2dd376 Mon Sep 17 00:00:00 2001 From: Ryan Libby Date: Sun, 26 May 2024 10:20:52 -0700 Subject: [PATCH] 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); }