Commit Graph

180 Commits

Author SHA1 Message Date
martin
7f15a337b2 Fix vm.bufmem* sysctl nodes for 64bit archs by making them uint64_t,
as discussed on tech-kern. No requests for binary compat - so don't
bother to version them.
2007-10-21 23:27:16 +00:00
ad
9f56dfa520 Merge brelse() changes from the vmlocking branch. 2007-10-08 18:02:53 +00:00
dsl
e4a2671dea Put the RCSID before any other headers 2007-09-16 15:17:36 +00:00
pooka
3f3cac88a3 Make bioops a pointer and point it to the softdeps struct in softdep
init.  Decouples "options SOFTDEP" from the main kernel and ffs code.
2007-09-01 23:40:21 +00:00
pooka
5a92d448e1 POOL_INIT -> pool_init, we need to call bufinit() anyway 2007-08-11 19:56:53 +00:00
ad
10b11b97b0 B_ERROR is gone. 2007-07-29 13:53:46 +00:00
ad
66fefd117b It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
2007-07-29 12:15:35 +00:00
ad
88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
yamt
f03010953f merge yamt-idlelwp branch. asked by core@. some ports still needs work.
from doc/BRANCHES:

	idle lwp, and some changes depending on it.

	1. separate context switching and thread scheduling.
	   (cf. gmcgarry_ctxsw)
	2. implement idle lwp.
	3. clean up related MD/MI interfaces.
	4. make scheduler(s) modular.
2007-05-17 14:51:11 +00:00
ad
59d979c5f1 Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
2007-03-12 18:18:22 +00:00
christos
53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
thorpej
4f3d5a9cc0 TRUE -> true, FALSE -> false 2007-02-22 06:34:42 +00:00
ad
b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
reinoud
ccc98bbca8 Export nestiobuf_iodone(). This allows nested iobufs to have a custom
call-back function that can then call the nestiobuf_iodone() to propagate.
2006-11-14 15:50:00 +00:00
yamt
1a7bc55dcc remove some __unused from function parameters. 2006-11-01 10:17:58 +00:00
christos
b83d29dc81 with the introduction of 512 byte buffers, the index in the array is not
the number of kilobytes anymore, so name the pools appropriately.
2006-10-16 16:50:12 +00:00
christos
4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
yamt
4d81bcfe21 unexport getnewbuf. 2006-09-10 06:35:42 +00:00
christos
931d28e672 use c99 initializers 2006-09-03 21:39:29 +00:00
yamt
c24f70bcad move wait points for kva from upper layers to vm_map. PR/33185 #1.
XXX there is a concern about interaction with kva fragmentation.
see: http://mail-index.NetBSD.org/tech-kern/2006/05/11/0000.html
2006-05-25 14:27:28 +00:00
elad
215bd95ba4 integrate kauth. 2006-05-14 21:15:11 +00:00
uwe
7494d34448 Tell config to generate fs_ffs.h as vfs_bio.c checks for defined(FFS).
Include that header in vfs_bio.c so that bioops are not redefined.
2006-04-05 00:52:16 +00:00
tls
2ebe53e4ac Add one more buffer pool, for 512-byte buffers. On the one hand, most
systems will never, ever need this -- because they use 8k/1k or even,
these days, 16k/2k or 32k/4k filesystems.  On the other hand, when you
do need this, you *really* need it: on anoncvs.netbsd.org, for instance,
where /tmp is 4k/512 and the filesystem contains tens or even hundreds
of thousands of single-frag directories, this essentially doubles the
efficiency of the allocator.  Since the overhead of keeping one extra
pool around is minimal, just add it by default.
2006-03-17 23:43:37 +00:00
christos
81b9ed737b Move ISSET/SET/CLR macros to sys/types.h 2006-03-05 16:57:16 +00:00
yamt
14962199bf nestiobuf_iodone: remove a comment which is no longer true. 2006-02-04 12:02:35 +00:00
reinoud
0071238956 Propagate an appropiate error code in nestiobuf_iodone() to the master
buffer when the passed nested buffer has no B_ERROR flag set but not all
was transfered for the nested iobuf extent.

Discussed on tech-kern and ok'd by Takashi
2006-01-21 14:09:35 +00:00
yamt
926005485e allocbuf: yield cpu in a loop. 2006-01-15 09:01:02 +00:00
yamt
3856e837b5 - use POOL_INIT for bufpool.
- make bufiopool static.
2006-01-15 08:27:07 +00:00
yamt
db2c8f4e34 add nestiobuf api for convenience when splitting a request to several pieces. 2006-01-11 00:44:41 +00:00
yamt
2addc3084c remove B_EINTR as it isn't used anymore. 2006-01-07 00:26:58 +00:00
yamt
6d5ea6e27c use a dedicated buf pool for getiobuf. 2006-01-05 10:18:20 +00:00
yamt
690d424f28 - add simple functions to allocate/free a buffer for i/o.
- make bufpool static.
2006-01-04 10:13:05 +00:00
perry
a2cd732268 Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 19:12:23 +00:00
christos
95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
atatat
420d91208b Properly fix the constipated lossage wrt -Wcast-qual and the sysctl
code.  I know it's not the prettiest code, but it seems to work rather
well in spite of itself.
2005-06-09 02:19:59 +00:00
christos
efb6943313 - add const.
- remove unnecessary casts.
- add __UNCONST casts and mark them with XXXUNCONST as necessary.
2005-05-29 22:24:14 +00:00
yamt
6b2d8b66a4 merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
  save some resources like pv_entry.  also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
2005-04-01 11:59:21 +00:00
chs
c92634930b fix validation of new values when setting vm.{hi,low}water. fixes PR 29651. 2005-03-31 02:34:10 +00:00
perry
da8abec863 nuke trailing whitespace 2005-02-26 21:34:55 +00:00
tls
abcbeb46d9 Users have observed that the amount of memory used by the metadata cache
can in some situations exceed the high-water mark, and stay there once it
gets there.  Adjust the canrelease function so that it will immediately
bring us back down to the high-water mark in this situation.

How can this happen at all?  Consider a machine with two filesystems, one
with a much larger blocksize than the other.  If the small-block filesystem
is very busy, growing the cache up to the high-water mark, and then the
large-block filesystem becomes busy, buffers will be recycled (since we
are at the high-water mark) but _grow each time they're recycled_.  Once
we're above the high-water mark, the canrelease call in allocbuf (without
this change) doesn't shrink us back down below it; so things get worse and
worse.
2005-01-10 15:29:50 +00:00
dbj
b2c6a6a4ea also define bioops if FFS is not defined. 2004-12-23 20:11:28 +00:00
jrf
ac053b9ef0 Fix previous commit, got bufcache and bufmem messages reversed. 2004-12-05 06:12:54 +00:00
jrf
cd5b5ced44 Change sysctl -d vm.bufcache to say percent of physical memory not
kernel memory. Addresses PR misc/27233. Approved by atatat@netbsd.org.
2004-12-05 06:00:20 +00:00
christos
dfa8d84485 PR/25749: Peter Postma: Missing splx() in kernel. 2004-11-13 19:16:18 +00:00
enami
4fa5fd9ed6 - Testing low memory condition to see if we should alloc or not doesn't make
sense, since 1) the condition is quite normal condition and 2) there is
  pool between us and uvm.
- Make the step of allocation possibility a bit seamless by moving the origin
  of curve from 0 to lowater mark.
Simon told that this helps for interactive performance when there is heavy
disk activity in PR#27057.
2004-10-04 01:24:18 +00:00
enami
51718e92ee Factor out code to set watermark and ensure high > low. 2004-10-04 00:46:05 +00:00
enami
682c3c9443 - Don't let pagedaemon sleep while draining buf.
- Estimate amount of memory to free at a time.
Address PR#27057 (and similar hangs I saw several months ago).
2004-10-03 08:47:48 +00:00
enami
ba25820566 x > 15 is always false if x is 0 .. 15.
# XXX: testing free memory here is quite doubtful.  also, I guess lowater
# XXX: is better than 0 as origin.
2004-10-03 08:30:09 +00:00
enami
778d21de43 Cheap test first. 2004-10-03 08:17:54 +00:00
yamt
3362d4ed5b fix allocbuf() O(n**2) behaviour where n is number of AGE buffers
by always tracking amount of buffers on a queue.
bump to 2.0H.
2004-09-18 16:37:12 +00:00