Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/net Abandon unnecessary softint
details: https://anonhg.NetBSD.org/src/rev/8f92c0795f93
branches: trunk
changeset: 358993:8f92c0795f93
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Thu Jan 25 02:45:02 2018 +0000
description:
Abandon unnecessary softint
The softint was introduced to defer fownsignal that was called in bpf_wakeup to
softint at v1.139, but now bpf_wakeup always runs in softint so we don't need
the softint anymore.
diffstat:
sys/net/bpf.c | 22 +++-------------------
sys/net/bpfdesc.h | 3 ++-
2 files changed, 5 insertions(+), 20 deletions(-)
diffs (85 lines):
diff -r 05c580905068 -r 8f92c0795f93 sys/net/bpf.c
--- a/sys/net/bpf.c Thu Jan 25 01:25:39 2018 +0000
+++ b/sys/net/bpf.c Thu Jan 25 02:45:02 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bpf.c,v 1.222 2017/12/15 07:29:11 ozaki-r Exp $ */
+/* $NetBSD: bpf.c,v 1.223 2018/01/25 02:45:02 ozaki-r Exp $ */
/*
* Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.222 2017/12/15 07:29:11 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.223 2018/01/25 02:45:02 ozaki-r Exp $");
#if defined(_KERNEL_OPT)
#include "opt_bpf.h"
@@ -268,7 +268,6 @@
static int bpf_stat(struct file *, struct stat *);
static int bpf_close(struct file *);
static int bpf_kqfilter(struct file *, struct knote *);
-static void bpf_softintr(void *);
static const struct fileops bpf_fileops = {
.fo_name = "bpf",
@@ -563,8 +562,6 @@
d->bd_atime = d->bd_mtime = d->bd_btime;
callout_init(&d->bd_callout, CALLOUT_MPSAFE);
selinit(&d->bd_sel);
- d->bd_sih = softint_establish(SOFTINT_CLOCK|SOFTINT_MPSAFE,
- bpf_softintr, d);
d->bd_jitcode = NULL;
d->bd_filter = NULL;
BPF_DLIST_ENTRY_INIT(d);
@@ -621,7 +618,6 @@
bpf_freed(d);
callout_destroy(&d->bd_callout);
seldestroy(&d->bd_sel);
- softint_disestablish(d->bd_sih);
mutex_obj_free(d->bd_mtx);
mutex_obj_free(d->bd_buf_mtx);
cv_destroy(&d->bd_cv);
@@ -756,23 +752,11 @@
mutex_exit(d->bd_buf_mtx);
if (d->bd_async)
- softint_schedule(d->bd_sih);
+ fownsignal(d->bd_pgid, SIGIO, 0, 0, NULL);
selnotify(&d->bd_sel, 0, 0);
}
static void
-bpf_softintr(void *cookie)
-{
- struct bpf_d *d;
-
- d = cookie;
- mutex_enter(d->bd_mtx);
- if (d->bd_async)
- fownsignal(d->bd_pgid, SIGIO, 0, 0, NULL);
- mutex_exit(d->bd_mtx);
-}
-
-static void
bpf_timed_out(void *arg)
{
struct bpf_d *d = arg;
diff -r 05c580905068 -r 8f92c0795f93 sys/net/bpfdesc.h
--- a/sys/net/bpfdesc.h Thu Jan 25 01:25:39 2018 +0000
+++ b/sys/net/bpfdesc.h Thu Jan 25 02:45:02 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bpfdesc.h,v 1.44 2017/02/09 09:30:26 ozaki-r Exp $ */
+/* $NetBSD: bpfdesc.h,v 1.45 2018/01/25 02:45:02 ozaki-r Exp $ */
/*
* Copyright (c) 1990, 1991, 1993
@@ -113,6 +113,7 @@
pid_t bd_pid; /* corresponding PID */
/* DEPRECATED. Keep it to avoid breaking kvm(3) users */
LIST_ENTRY(bpf_d) _bd_list; /* list of all BPF's */
+ /* DEPRECATED. Keep it to avoid breaking kvm(3) users */
void *bd_sih; /* soft interrupt handle */
struct timespec bd_atime; /* access time */
struct timespec bd_mtime; /* modification time */
Home |
Main Index |
Thread Index |
Old Index