From: claudio Date: Wed, 9 Nov 2022 22:25:36 +0000 (+0000) Subject: Remove kernel lock here since msleep() with PCATCH no longer requires it. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=eadad9f1af94df863ba43435828df1c86eadd88d;p=openbsd Remove kernel lock here since msleep() with PCATCH no longer requires it. OK mpi@ --- diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 159531d30e9..388691ee69d 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_event.c,v 1.193 2022/08/14 01:58:27 jsg Exp $ */ +/* $OpenBSD: kern_event.c,v 1.194 2022/11/09 22:25:36 claudio Exp $ */ /*- * Copyright (c) 1999,2000,2001 Jonathan Lemon @@ -1287,14 +1287,10 @@ retry: error = 0; reinserted = 0; - /* msleep() with PCATCH requires kernel lock. */ - KERNEL_LOCK(); - mtx_enter(&kq->kq_lock); if (kq->kq_state & KQ_DYING) { mtx_leave(&kq->kq_lock); - KERNEL_UNLOCK(); error = EBADF; goto done; } @@ -1307,14 +1303,12 @@ retry: if ((tsp != NULL && !timespecisset(tsp)) || scan->kqs_nevent != 0) { mtx_leave(&kq->kq_lock); - KERNEL_UNLOCK(); error = 0; goto done; } kq->kq_state |= KQ_SLEEP; error = kqueue_sleep(kq, tsp); /* kqueue_sleep() has released kq_lock. */ - KERNEL_UNLOCK(); if (error == 0 || error == EWOULDBLOCK) goto retry; /* don't restart after signals... */ @@ -1323,9 +1317,6 @@ retry: goto done; } - /* The actual scan does not sleep on kq, so unlock the kernel. */ - KERNEL_UNLOCK(); - /* * Put the end marker in the queue to limit the scan to the events * that are currently active. This prevents events from being