From 5d83d1504c2ddbb8beaf275a26464609ba9b13f5 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Sun, 20 Dec 2015 18:19:07 +0800 Subject: [PATCH] socket: Don't use NOTE_OOB as hint for KNOTE upon OOB It is not necessary, and would cause penalty if there was knote processing contention. Add comment about it. --- sys/kern/uipc_socket.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index aa35638f23..2266141f70 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -2487,7 +2487,14 @@ sohasoutofband(struct socket *so) { if (so->so_sigio != NULL) pgsigio(so->so_sigio, SIGURG, 0); - KNOTE(&so->so_rcv.ssb_kq.ki_note, NOTE_OOB); + /* + * NOTE: + * There is no need to use NOTE_OOB as KNOTE hint here: + * soread filter depends on so_oobmark and SS_RCVATMARK + * so_state. NOTE_OOB would cause unnecessary penalty + * in KNOTE, if there was knote processing contention. + */ + KNOTE(&so->so_rcv.ssb_kq.ki_note, 0); } int -- 2.41.0