From 06c3e122cfb865f260289523b5cd8c4d422dab77 Mon Sep 17 00:00:00 2001 From: visa Date: Fri, 6 May 2022 13:09:41 +0000 Subject: [PATCH] Replace selwakeup() with KNOTE() in pipe and socket event activation. OK mpi@ --- sys/kern/sys_pipe.c | 9 ++------- sys/kern/uipc_socket.c | 4 ++-- sys/kern/uipc_socket2.c | 4 ++-- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 5168916e405..daa6b2ad1c4 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_pipe.c,v 1.136 2022/02/13 13:05:51 visa Exp $ */ +/* $OpenBSD: sys_pipe.c,v 1.137 2022/05/06 13:09:41 visa Exp $ */ /* * Copyright (c) 1996 John S. Dyson @@ -374,12 +374,7 @@ pipeselwakeup(struct pipe *cpipe) { rw_assert_wrlock(cpipe->pipe_lock); - if (cpipe->pipe_state & PIPE_SEL) { - cpipe->pipe_state &= ~PIPE_SEL; - selwakeup(&cpipe->pipe_sel); - } else { - KNOTE(&cpipe->pipe_sel.si_note, 0); - } + KNOTE(&cpipe->pipe_sel.si_note, 0); if (cpipe->pipe_state & PIPE_ASYNC) pgsigio(&cpipe->pipe_sigio, SIGIO, 0); diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 0d721fbed00..fc485fdad54 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket.c,v 1.275 2022/02/25 23:51:03 guenther Exp $ */ +/* $OpenBSD: uipc_socket.c,v 1.276 2022/05/06 13:09:41 visa Exp $ */ /* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */ /* @@ -2039,7 +2039,7 @@ void sohasoutofband(struct socket *so) { pgsigio(&so->so_sigio, SIGURG, 0); - selwakeup(&so->so_rcv.sb_sel); + KNOTE(&so->so_rcv.sb_sel.si_note, 0); } int diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index befc826548d..550779809b0 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket2.c,v 1.120 2022/02/25 23:51:03 guenther Exp $ */ +/* $OpenBSD: uipc_socket2.c,v 1.121 2022/05/06 13:09:41 visa Exp $ */ /* $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $ */ /* @@ -423,7 +423,7 @@ sowakeup(struct socket *so, struct sockbuf *sb) } if (sb->sb_flags & SB_ASYNC) pgsigio(&so->so_sigio, SIGIO, 0); - selwakeup(&sb->sb_sel); + KNOTE(&sb->sb_sel.si_note, 0); } /* -- 2.20.1