3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright (c) 1986, 2010, Oracle and/or its affiliates. All rights reserved.
23 */
24
25 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
26 /* All Rights Reserved */
27
28 /*
29 * University Copyright- Copyright (c) 1982, 1986, 1988
30 * The Regents of the University of California
31 * All Rights Reserved
32 *
33 * University Acknowledgment- Portions of this document are derived from
34 * software developed by the University of California, Berkeley, and its
35 * contributors.
36 */
37
38 #include <sys/types.h>
39 #include <sys/t_lock.h>
40 #include <sys/param.h>
41 #include <sys/errno.h>
42 #include <sys/debug.h>
56 #include <sys/vnode.h>
57 #include <sys/file.h>
58 #include <sys/vm.h>
59
60 #include <sys/swap.h>
61 #include <sys/vtrace.h>
62 #include <sys/tnf_probe.h>
63 #include <sys/fs/snode.h>
64 #include <sys/copyops.h>
65 #include <sys/conf.h>
66 #include <sys/sdt.h>
67
68 #include <vm/anon.h>
69 #include <vm/hat.h>
70 #include <vm/as.h>
71 #include <vm/seg.h>
72 #include <vm/page.h>
73 #include <vm/seg_vn.h>
74 #include <vm/seg_kmem.h>
75
76 extern int maxphys;
77
78 void
79 minphys(struct buf *bp)
80 {
81 if (bp->b_bcount > maxphys)
82 bp->b_bcount = maxphys;
83 }
84
85 /*
86 * use kmem_cache_create for physio buffers. This has shown
87 * a better cache distribution compared to buffers on the
88 * stack. It also avoids semaphore construction/deconstruction
89 * per request
90 */
91
92 static struct kmem_cache *physio_buf_cache;
93
94 /* ARGSUSED */
95 static int
96 physio_buf_constructor(void *buf, void *cdrarg, int kmflags)
|
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright (c) 1986, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
24 */
25
26 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
27 /* All Rights Reserved */
28
29 /*
30 * University Copyright- Copyright (c) 1982, 1986, 1988
31 * The Regents of the University of California
32 * All Rights Reserved
33 *
34 * University Acknowledgment- Portions of this document are derived from
35 * software developed by the University of California, Berkeley, and its
36 * contributors.
37 */
38
39 #include <sys/types.h>
40 #include <sys/t_lock.h>
41 #include <sys/param.h>
42 #include <sys/errno.h>
43 #include <sys/debug.h>
57 #include <sys/vnode.h>
58 #include <sys/file.h>
59 #include <sys/vm.h>
60
61 #include <sys/swap.h>
62 #include <sys/vtrace.h>
63 #include <sys/tnf_probe.h>
64 #include <sys/fs/snode.h>
65 #include <sys/copyops.h>
66 #include <sys/conf.h>
67 #include <sys/sdt.h>
68
69 #include <vm/anon.h>
70 #include <vm/hat.h>
71 #include <vm/as.h>
72 #include <vm/seg.h>
73 #include <vm/page.h>
74 #include <vm/seg_vn.h>
75 #include <vm/seg_kmem.h>
76
77 #include <sys/sunddi.h>
78
79 void
80 minphys(struct buf *bp)
81 {
82 if (bp->b_bcount > maxphys)
83 bp->b_bcount = maxphys;
84 }
85
86 /*
87 * use kmem_cache_create for physio buffers. This has shown
88 * a better cache distribution compared to buffers on the
89 * stack. It also avoids semaphore construction/deconstruction
90 * per request
91 */
92
93 static struct kmem_cache *physio_buf_cache;
94
95 /* ARGSUSED */
96 static int
97 physio_buf_constructor(void *buf, void *cdrarg, int kmflags)
|