socket: Don't use NOTE_OOB as hint for KNOTE upon OOB
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 20 Dec 2015 10:19:07 +0000 (18:19 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 20 Dec 2015 10:19:07 +0000 (18:19 +0800)
It is not necessary, and would cause penalty if there was knote
processing contention.  Add comment about it.

sys/kern/uipc_socket.c

index aa35638..2266141 100644 (file)
@@ -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