Commit Graph

100 Commits

Author SHA1 Message Date
jdolecek
508f8978c8 according to benchmark extracting pkgsrc.tar, using FUA and hence waiting
for each transfer to write through to the medium is way slower than just
letting the drive use a cached write and doing DIOCCACHESYNC on the end

Results were (fs block 32KB / frag 4KB, partition aligned on 32KB boundary):
HDD at siisata(4):  no-FUA: 108 sec w/FUA: 294 sec
SSD at ahcisata(4): no-FUA:  73 sec w/FUA: 502 sec

change the flag so that FUA is only used for the commit block write;
for journal data write, only pass DPO, rely on the cache flush to get them
to media
2017-12-02 17:29:55 +00:00
joerg
e64612f440 Revert printf return value change. 2017-10-27 12:25:14 +00:00
utkarsh009
f11595bab5 [syzkaller] Cast all the printf's to (void *)
> as a result of new printf(9) declaration.
2017-10-27 09:59:16 +00:00
jdolecek
d3e642e387 remove counter for 'journal I/O bufs biowait' - it's (total - async), so
superfluous; adjust the description of the the other counters a bit to make
them more clear
2017-10-23 19:03:40 +00:00
chs
ec5ea71a90 move some buffer cache internals declarations from buf.h to vfs_bio.c.
this is needed to avoid name conflicts with ZFS and also
makes it clearer that other code shouldn't be messing with these.
remove the LFS debug code that poked around in bufqueues and
remove the BQ_EMPTY bufqueue since nothing uses it anymore.
provide a function to let LFS and wapbl read the value of nbuf for now.
2017-06-08 01:23:01 +00:00
jdolecek
6ef596151b rename allow_fuadpo to allow_dpofua, so it's the same order as the SCSI flag 2017-04-10 21:36:05 +00:00
jdolecek
75f6d4fd1a improve performance of journal writes by parallelizing the I/O - use 4 bufs
by default, add sysctl vfs.wapbl.journal_iobufs to control it

this also removes need to allocate iobuf during commit, so it
might help to avoid deadlock during memory shortages like PR kern/47030
2017-04-10 21:34:37 +00:00
jdolecek
946ca69f6d change b_wapbllist to TAILQ, to preserve the LRU order 2017-04-10 19:52:38 +00:00
jdolecek
046f6d9783 optionally use FUA instead of full cache sync, and DPO for journal writes,
when supported by disk device; controlled by sysctl vfs.wapbl.allow_fuadpo,
default off for now

discussed on tech-kern
2017-04-05 20:38:53 +00:00
riastradh
29079373a1 Back out part of previous: missed a caller of wapbl_write_inodes. 2017-03-17 03:19:46 +00:00
riastradh
ba1ca8c6fb Nix trailing whitespace. 2017-03-17 03:17:07 +00:00
riastradh
eafae67faa Sort includes. 2017-03-17 03:16:29 +00:00
riastradh
76681fe093 Assert write lock in wapbl_write_revocations, wapbl_write_inodes.
Only one call site, so trivial to prove correct.
2017-03-17 03:06:17 +00:00
mrg
e99ba17226 add missing sys/evcnt.h include. 2017-03-05 20:45:49 +00:00
jdolecek
54d8d0371a add some event counters, for commits, writes, cache flush 2017-03-05 13:57:29 +00:00
jdolecek
86e8a3aae2 during truncate with wapbl, register deallocation for upper indirect block
before recursing into lower blocks, to make sure that it will be removed after
all its referenced blocks are removed

fixes 'ffs_blkfree_common: freeing free block' panic triggered by
ufs_truncate_retry() when just the upper indirect block registration failed,
code tried to free the lower blocks again after wapbl flush

problem found by hannken@, thank you
2016-11-10 20:56:32 +00:00
jdolecek
b695bc874e reorganize ffs_truncate()/ffs_indirtrunc() to be able to partially
succeed; change wapbl_register_deallocation() to return EAGAIN
rather than panic when code hits the limit

callers changed to either loop calling ffs_truncate() using new
utility ufs_truncate_retry() if their semantics requires it, or
just ignore the failure; remove ufs_wapbl_truncate()

this fixes possible user-triggerable panic during truncate, and
resolves WAPBL performance issue with truncates of large files

PR kern/47146 and kern/49175
2016-10-28 20:38:12 +00:00
jdolecek
9e58801f20 drop wl_mtx mutex during call to pool_get() with PR_WAITOK
pointed out by riastradh
2016-10-02 16:52:27 +00:00
jdolecek
407be399a4 fix off-by-one in wapbl_write_revocations() - when exiting the write loop,
wd gets set to next unwritten record, not last written one as code assumed;
'lost head!' KASSERT is not triggered any more
2016-10-02 16:44:02 +00:00
jdolecek
c69152bd80 wapbl_write_revocations(): fix use-after-free when writing more then one
block worth of revocations, introduced in previous commit; discovered by
Brad Harder on current-users
2016-10-02 14:38:46 +00:00
jdolecek
16c7d9d735 allocate wapbl dealloc registration structures via pool, so that there is more
flexibility with limit handling
2016-10-01 13:15:45 +00:00
jdolecek
e3cebdd8d5 misplaced comment 2016-09-22 16:22:29 +00:00
jdolecek
d6c67f4b63 store the number of block records per block into wl as wl_brperjblock,
so that it's visible it's same value everywhere; no functional change
2016-09-22 16:20:56 +00:00
riastradh
950b6c0b3d Replace deprecated disabled code by comment
describing what it intends to do, and why it won't work yet

From coypu.
2016-05-19 18:32:29 +00:00
riastradh
6e111d367d Tweak comment on wapbl_flush. 2016-05-07 22:12:29 +00:00
riastradh
193947f42e Use %jx and a cast to uintmax_t, not %x, to print a dev_t. 2016-05-07 21:15:38 +00:00
riastradh
895c0fab4b Clarify comment about early exit from wapbl_flush.
Note possible bug.  Requires further analysis.
2016-05-07 21:11:51 +00:00
riastradh
2b3e02eb3e Omit unused parameter to wapbl_fini. 2016-05-07 20:59:46 +00:00
riastradh
c04b67eb10 Delete debugging option wapbl_lazy_truncate. Simplify.
Likely nobody has used this in the past decade -- you would have to
enter ddb and write 1 to it in order to enable it anyway.

Patch prepared by coypu.
2016-05-07 20:39:33 +00:00
riastradh
5589cef4c7 Turn WAPBL_DEBUG panic or KASSERT into KASSERTMSG
From coypu.
2016-05-07 20:18:44 +00:00
riastradh
c4a5d0a629 Document log layout and internal subroutines of vfs_wapbl.c. 2016-05-07 20:16:38 +00:00
riastradh
ef3ee9e48d KASSERT(A); KASSERT(B) instead of KASSERT(A && B). 2016-05-07 17:47:34 +00:00
riastradh
e551e5630a Rename labels to make wapbl_flush a little easier to follow.
out ---> wait_out
out2 ---> out

From coypu.
2016-05-07 17:12:22 +00:00
riastradh
d6c3919f02 Sort and deduplicate includes. 2016-05-07 06:38:47 +00:00
riastradh
7347c31c51 Fix non-DIAGNOSTIC build. 2016-05-03 19:43:45 +00:00
riastradh
36bc16361e panic takes no \n.
From coypu.
2016-05-03 19:17:16 +00:00
riastradh
22f2d8e6d4 #ifdef DIAGNOSTIC panic ---> KASSERTMSG
From coypu.
2016-05-03 19:15:29 +00:00
pgoyette
3b2f494e00 Enable the module's MODULE_CMD_FINI action. It actually works as
intended.
2015-11-15 03:09:39 +00:00
pgoyette
ceb937987d Fix obvious typo - even though it is inside a #ifdef notyet ... #endif 2015-11-14 03:25:53 +00:00
mlelstv
5661eb436a Refactor disk address calculation from physical block numbers in
the journal into a function. Make that function work correctly with
sector sizes != DEV_BSIZE when compiled outside the kernel (i.e.
fsck_ffs).
Fixes PR bin/45933
2015-08-09 07:40:59 +00:00
snj
f0a7346d21 src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
2014-10-18 08:33:23 +00:00
matt
a35d1a8c7c Don't next structure and enum definitions.
Don't use C++ keywords new, try, class, private, etc.
2014-09-05 05:57:21 +00:00
pooka
4f6fb3bf35 Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.
2014-02-25 18:30:08 +00:00
martin
7dbdb14bec Remove unused variable 2013-09-15 15:57:26 +00:00
joerg
28cfffa6f7 Provide a prototype for wapbl_space_free under _KERNEL. 2013-09-15 08:11:33 +00:00
joerg
106176e34b wapbl_advance and friends are only used in the kernel 2013-09-14 13:19:50 +00:00
christos
752baf2503 why didn't gcc find the formatting error? 2013-02-09 00:32:12 +00:00
hannken
e0783eff3d Try to coalesce writes to the journal in MAXPHYS sized and aligned blocks.
Speeds up wapbl_flush() on raid5 by a factor of 3-4.

Discussed on tech-kern.

Needs pullup to NetBSD-6.
2012-12-08 07:24:42 +00:00
hannken
0253e4d99a wapbl_biodone: Release the buffer before reclaiming the log.
wapbl_flush() may wait for the log to become empty and
    all buffers should be unbusy before it returns.
2012-11-17 10:10:17 +00:00
chs
67b37d586b mark all wapbl I/O as BPRIO_TIMECRITICAL.
this is the second part of addressing PR 46325.
2012-04-29 22:55:11 +00:00