Commit Graph

214 Commits

Author SHA1 Message Date
joerg
92a83dd9cf Backout revision 1.212 and add a comment that short-cutting the WAPBL
case is not possible. The buffer length has changed and the rounded size
may not have, essentially changing the transaction size. Reported by
various users and in PR 39898.
2008-11-16 19:34:19 +00:00
joerg
b9400f6fd4 Move WAPL replay handling from bread() into ufs_strategy.
This changes the order of hook processing as the copy-on-write handlers
are called after the journal processing. This makes more sense as the
journal overwrite is logically part of the disk IO.
2008-11-11 08:29:58 +00:00
joerg
d1cd6d3433 If the size of the buffer didn't change, don't bother updating the WAPBL
accounting as it won't change either.
2008-11-10 21:02:15 +00:00
reinoud
97c1950356 Don't dereference bp->b_vp->v_mount if its vnode type is VT_VNON. I dont
know if this masks a bug but with a machine having a ffs+wapbl mount, NFS
mounts and a ntfs mount this paniced the machine on suspend.
2008-11-04 16:08:41 +00:00
hannken
3034f37f42 nestiobuf_setup(): Initialize b_dev from master buffer. 2008-09-11 09:14:46 +00:00
reinoud
bd424bd73b Accidental commit, but asserts buffer cache lock held 2008-08-30 08:55:53 +00:00
simonb
36d65f1138 Merge the simonb-wapbl branch. From the original branch commit:
Add Wasabi System's WAPBL (Write Ahead Physical Block Logging)
   journaling code.  Originally written by Darrin B. Jewell while
   at Wasabi and updated to -current by Antti Kantee, Andy Doran,
   Greg Oster and Simon Burge.

OK'd by core@, releng@.
2008-07-31 05:38:04 +00:00
hannken
0d6dbadf45 bdwrite(): The COWDONE check may fire for special vnodes with mounted
non-ffs file system.  Remove VBLK vnodes from the check.

Should fix PR kern/38892
2008-07-14 16:22:42 +00:00
bouyer
52346627a5 kern/39052: fix broken assertion. We can have a BC_BUSY buffer in the LRU
queue, if it's being flushed. But in this case, we'll also have B_VFLUSH.

While there fix checkfreelist() so that it can be used to check that a
buffer is not in the free lists.
2008-07-06 15:00:45 +00:00
mlelstv
76a664c61a Drop !cv_has_waiters assertion.
bdirty() is called from within biodone() processing before
waiters have been woken up and removed.

N.B. it is also used by smbfs.
2008-06-17 19:14:14 +00:00
reinoud
f6a70673ba Mark a buffer busy in getnewbuf() when it came from the pool_cache since
its not on a free list.

Also change buf_init() to not automatically mark buffers `busy' since this
only makes sense for bufcache buffers.

Mark all buf_init'd buffers 'busy' on the places where they ought to be
flagged as such to not confuse the buffer cache.

Fixes PR 38923.
2008-06-17 14:53:10 +00:00
ad
5bfa865311 Sprinkle more assertions. 2008-06-16 09:47:55 +00:00
ad
6a33531fe1 - Make getiobuf() return buffers marked BUSY.
- Sprinkle more assertions.
2008-06-06 12:49:15 +00:00
ad
506130b087 biodone2: if the buffer is async or has a callback method, assert that
there are no waiters on b_done (threads in biowait()).
2008-05-31 13:41:44 +00:00
ad
a6f1414cd1 tsleep -> kpause 2008-05-31 13:26:29 +00:00
ad
46540aaf0e brelse: always wakeup on b_busy, in case BC_WANTED is not set. 2008-05-26 14:56:55 +00:00
hannken
5d2bff060a Make sure all cached buffers with valid, not yet written data have been
run through copy-on-write.  Call fscow_run() with valid data where possible.

The LP_UFSCOW hack is no longer needed to protect ffs_copyonwrite() against
endless recursion.

- Add a flag B_MODIFY to bread(), breada() and breadn().  If set the caller
  intends to modify the buffer returned.

- Always run copy-on-write on buffers returned from ffs_balloc().

- Add new function ffs_getblk() that gets a buffer, assigns a new blkno,
  may clear the buffer and runs copy-on-write.  Process possible errors
  from getblk() or fscow_run().  Part of PR kern/38664.

Welcome to 4.99.63

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>
2008-05-16 09:21:59 +00:00
ad
e071d39c84 - Convert hashinit() to use kmem_alloc(). The hash tables can be large
and it's better to not have them in kmem_map.
- Convert a couple of minor items along the way to kmem_alloc().
- Fix some memory leaks.
2008-05-05 17:11:16 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
reinoud
0971ac9234 When using nested buffers, allow one erroring-out nested buffer to
error-out the master buffer.

The old setup was undeterministic since a later sheduled nested buffer
could clear the error again since there is no B_ERROR flag anymore. It also
would discard the error the nested buffer returned.
2008-04-22 11:05:06 +00:00
ad
be04ac4896 Make rusage collection per-LWP and collate in the appropriate places.
cloned threads need a little bit more work but the locking needs to
be fixed first.
2008-03-27 19:06:51 +00:00
yamt
91ae756395 - for some ports, especially for ones without pmap_growkernel,
buf_memcalc is used by bootstrap as well.  fix NULL dereference for them.
- limit kva usage for each cache to 20% of vm_map.  XXX a bit arbitrary.
- add a comment.
2008-03-25 23:21:42 +00:00
yamt
93109cd91b when calculating some cache sizes, consider the amount of available kva.
PR/33185.
2008-03-23 10:39:52 +00:00
yamt
d3bb744af3 make buf_map static. 2008-03-23 10:33:15 +00:00
yamt
a890fa326d update a comment. 2008-02-29 12:10:09 +00:00
matt
e2ca3f7504 Merge all the *different* definitions of bufqueues into one common one. 2008-02-20 17:13:29 +00:00
ad
fb00b83874 Give bbusy() an interlock argument. If the we need to wait for the buffer,
the interlock is dropped and reacquired when awoken. This allows for
busying buffers attached to a list that is not locked by bufcache_lock.
2008-02-15 13:46:04 +00:00
ad
b2fa822a33 The buffer LOCKED flag need not be under the protection of bufcache_lock,
BUSY is enough.
2008-02-15 13:30:56 +00:00
hannken
35f84b8843 BO_COWDONE -> B_COWDONE: this flag is tested/modified from the thread owning
the buffer and therefore needs no protection by a mutex.

Ok: Andrew Doran <ad@netbsd.org>
2008-02-02 16:51:34 +00:00
ad
77e0b2120f Patch up sysctl locking:
- Lock processes, credentials, filehead etc correctly.
- Acquire a read hold on sysctl_treelock if only doing a query.
- Don't wire down the output buffer. It doesn't work correctly and the code
  regularly does long term sleeps with it held - it's not worth it.
- Don't hold locks other than sysctl_lock while doing copyout().
- Drop sysctl_lock while doing copyout / allocating memory in a few places.
- Don't take kernel_lock for sysctl.
- Fix a number of bugs spotted along the way
2008-01-07 16:12:52 +00:00
ad
a32939fca4 bwrite, bdwrite: bufcache_lock must be held for reassignbuf. 2008-01-07 12:50:38 +00:00
ad
4a780c9ae2 Merge vmlocking2 to head. 2008-01-02 11:48:20 +00:00
ad
bc64d5411e b_un.b_addr -> b_data 2007-12-24 15:00:20 +00:00
hannken
d556dc98b0 Fscow_run(): add a flag "bool data_valid" to note still valid data.
Buffers run through copy-on-write are marked B_COWDONE.  This condition
is valid until the buffer has run through bwrite() and gets cleared from
biodone().

Welcome to 4.99.39.

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>
2007-12-02 13:56:15 +00:00
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