diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-02-14 10:31:16 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-02-14 10:31:16 +0000 |
commit | 34a596aab6fe02a7cab135b3cb5b62cc4d6a1b87 (patch) | |
tree | 366649e56602029a642e4e0b018e45b31a0c8095 /sys/net | |
parent | 93fb91980a53f93e45136a0d9854857d81ca5aec (diff) |
Convert most of the manual checks for CPU hogging to sched_pause().
The distinction between preempt() and yield() stays as it is usueful
to know if a thread decided to yield by itself or if the kernel told
him to go away.
ok tedu@, guenther@
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/pf_table.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/net/pf_table.c b/sys/net/pf_table.c index e26589d9bc9..708bd68cbcd 100644 --- a/sys/net/pf_table.c +++ b/sys/net/pf_table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_table.c,v 1.124 2017/02/09 10:29:37 mpi Exp $ */ +/* $OpenBSD: pf_table.c,v 1.125 2017/02/14 10:31:15 mpi Exp $ */ /* * Copyright (c) 2002 Cedric Berger @@ -73,8 +73,7 @@ (bcopy((from), (to), (size)), 0)) #define YIELD(cnt, ok) \ - if (curcpu()->ci_schedstate.spc_schedflags & SPCF_SHOULDYIELD) \ - preempt(NULL) \ + sched_pause(preempt) #define FILLIN_SIN(sin, addr) \ do { \ |