Thu Apr 23 00:34:29 2020 UTC ()
rump doesn't own pnbuf_cache, externalize it


(joerg)
diff -r1.344 -r1.345 src/sys/rump/librump/rumpkern/rump.c

cvs diff -r1.344 -r1.345 src/sys/rump/librump/rumpkern/rump.c (expand / switch to unified diff)

--- src/sys/rump/librump/rumpkern/rump.c 2020/03/23 14:49:50 1.344
+++ src/sys/rump/librump/rumpkern/rump.c 2020/04/23 00:34:29 1.345
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rump.c,v 1.344 2020/03/23 14:49:50 pgoyette Exp $ */ 1/* $NetBSD: rump.c,v 1.345 2020/04/23 00:34:29 joerg Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. 4 * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
@@ -16,27 +16,27 @@ @@ -16,27 +16,27 @@
16 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE. 25 * SUCH DAMAGE.
26 */ 26 */
27 27
28#include <sys/cdefs.h> 28#include <sys/cdefs.h>
29__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.344 2020/03/23 14:49:50 pgoyette Exp $"); 29__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.345 2020/04/23 00:34:29 joerg Exp $");
30 30
31#include <sys/systm.h> 31#include <sys/systm.h>
32#define ELFSIZE ARCH_ELFSIZE 32#define ELFSIZE ARCH_ELFSIZE
33 33
34#include <sys/param.h> 34#include <sys/param.h>
35#include <sys/atomic.h> 35#include <sys/atomic.h>
36#include <sys/buf.h> 36#include <sys/buf.h>
37#include <sys/callout.h> 37#include <sys/callout.h>
38#include <sys/conf.h> 38#include <sys/conf.h>
39#include <sys/cpu.h> 39#include <sys/cpu.h>
40#include <sys/device.h> 40#include <sys/device.h>
41#include <sys/evcnt.h> 41#include <sys/evcnt.h>
42#include <sys/event.h> 42#include <sys/event.h>
@@ -104,27 +104,27 @@ struct device rump_rootdev = { @@ -104,27 +104,27 @@ struct device rump_rootdev = {
104int rump_threads = 0; 104int rump_threads = 0;
105#else 105#else
106int rump_threads = 1; 106int rump_threads = 1;
107#endif 107#endif
108 108
109static void rump_component_addlocal(void); 109static void rump_component_addlocal(void);
110static struct lwp *bootlwp; 110static struct lwp *bootlwp;
111 111
112/* 16k should be enough for std rump needs */ 112/* 16k should be enough for std rump needs */
113static char rump_msgbuf[16*1024] __aligned(256); 113static char rump_msgbuf[16*1024] __aligned(256);
114 114
115bool rump_ttycomponent = false; 115bool rump_ttycomponent = false;
116 116
117pool_cache_t pnbuf_cache; 117extern pool_cache_t pnbuf_cache;
118 118
119static int rump_inited; 119static int rump_inited;
120 120
121void (*rump_vfs_drainbufs)(int) = (void *)nullop; 121void (*rump_vfs_drainbufs)(int) = (void *)nullop;
122int (*rump_vfs_makeonedevnode)(dev_t, const char *, 122int (*rump_vfs_makeonedevnode)(dev_t, const char *,
123 devmajor_t, devminor_t) = (void *)nullop; 123 devmajor_t, devminor_t) = (void *)nullop;
124int (*rump_vfs_makedevnodes)(dev_t, const char *, char, 124int (*rump_vfs_makedevnodes)(dev_t, const char *, char,
125 devmajor_t, devminor_t, int) = (void *)nullop; 125 devmajor_t, devminor_t, int) = (void *)nullop;
126int (*rump_vfs_makesymlink)(const char *, const char *) = (void *)nullop; 126int (*rump_vfs_makesymlink)(const char *, const char *) = (void *)nullop;
127 127
128rump_proc_vfs_init_fn rump_proc_vfs_init = (void *)nullop; 128rump_proc_vfs_init_fn rump_proc_vfs_init = (void *)nullop;
129rump_proc_vfs_release_fn rump_proc_vfs_release = (void *)nullop; 129rump_proc_vfs_release_fn rump_proc_vfs_release = (void *)nullop;
130 130