Joe Thornber
5052970da3
bcache: Don't call sysconf for every io
2018-05-17 10:05:10 +01:00
Alex Bennée
c6ca81a38d
bcache: don't use PAGE_SIZE compile const
...
PAGE_SIZE is not a compile time constant. Use sysconf instead like
elsewhere in the code.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2018-05-17 10:38:16 +02:00
Joe Thornber
e296f784c9
Merge branch 'master' of git://sourceware.org/git/lvm2
2018-05-16 10:11:58 +01:00
Joe Thornber
df2acbbb97
bcache: nr_ios_pending wasn't being incremented
...
... but it was being decremented on completion. Which meant
it wrapped, and no prefetches were ever issued after the
first completion.
2018-05-16 10:09:17 +01:00
Zdenek Kabelac
ac768a9d2b
bcache: do not use libdm header files
...
Logging for libdm differs from lvm logging - keep using consisten
logging function calls.
2018-05-12 18:18:23 +02:00
Joe Thornber
5f780813f2
bcache/sync io engine: handle short ios
2018-05-11 05:37:47 +01:00
Joe Thornber
ae50374811
bcache: Add sync io engine
...
Something to fall back to when testing.
2018-05-10 14:29:26 +01:00
Joe Thornber
67b80e2d9d
bcache: knock out err param.
...
Dave used this for debugging. Not needed in general.
2018-05-10 13:26:08 +01:00
Joe Thornber
efad84ebc2
bcache: Move the utils to a separate file.
...
This makes it clearer that they don't access the cache internals.
2018-05-03 09:34:41 +01:00
Joe Thornber
b3c41bce3d
bcache: add bcache_block_sectors() query fn
2018-05-03 09:33:55 +01:00
Joe Thornber
90d0ff6636
bcache: reorder includes in .c file too
2018-05-02 19:45:06 +01:00
Joe Thornber
bfc61a9543
bcache: squash some warnings on rhel6
2018-05-01 13:21:53 +01:00
Joe Thornber
f564e78d98
bcache: rewrite bcache_{write,zero}_bytes
...
These are utility functions so should only use the public interface.
Also write_bytes was flushing, which will kill performance.
2018-05-01 12:07:33 +01:00
Joe Thornber
e890c37704
[bcache] Some work on bcache_invalidate()
...
bcache_invalidate() now returns a bool to indicate success. If fails
if the block is currently held, or the block is dirty and writeback
fails.
Added a bunch of unit tests for the invalidate functions.
Fixed some bugs to do with invalidating errored blocks.
2018-04-27 10:56:13 +01:00
Joe Thornber
1c97fda425
[bcache] get all unit tests passing again
2018-04-26 13:13:27 +01:00
David Teigland
6d05859862
bcache: let caller see an error
2018-04-20 11:22:48 -05:00
David Teigland
570c6239ee
bcache: fix error handling
...
The error handling code wasn't working, but it
appears that just removing it is what we need.
The doesn't really need any different behavior
related to bcache blocks on an io error, it just
wants to know if there was an error.
2018-04-20 11:22:47 -05:00
David Teigland
4331182964
bcache: add some error messages for debugging
2018-04-20 11:22:47 -05:00
David Teigland
8065492046
bcache: do all writes through bcache
2018-04-20 11:22:47 -05:00
David Teigland
8b26a007b1
misc bcache fixes from ejt
2018-04-20 11:22:47 -05:00
David Teigland
a7cb76ae94
scan: use bcache for label scan and vg read
...
New label_scan function populates bcache for each device
on the system.
The two read paths are updated to get data from bcache.
The bcache is not yet used for writing. bcache blocks
for a device are invalidated when the device is written.
2018-04-20 11:19:24 -05:00
David Teigland
93fc937429
[device/bcache] bcache_read_bytes should put blocks
2018-04-20 11:12:50 -05:00
David Teigland
7be54bd687
[device/bcache] fix min() function
2018-04-20 11:12:50 -05:00
David Teigland
d9e6298edb
[device/bcache] fix missing max_io fn in bcache async engine
2018-04-20 11:12:50 -05:00
Joe Thornber
dc8034f5eb
[device/bcache] more work on bcache
2018-04-20 11:12:50 -05:00
Joe Thornber
6a57ed17a2
[device/bcache] add bcache_prefetch_bytes() and bcache_read_bytes()
...
Not tested yet.
2018-04-20 11:12:50 -05:00
Joe Thornber
467adfa082
[device/bcache] More tests and some bug fixes
2018-04-20 11:12:50 -05:00
Joe Thornber
19647d1cd4
[device/bcache] fix bug in _alloc_block
2018-04-20 11:12:50 -05:00
Joe Thornber
1563b93691
[device/bcache] Add bcache_max_prefetches()
...
Ignore prefetches if max io is in flight.
2018-04-20 11:12:50 -05:00
Joe Thornber
c4c4acfd42
[device/bcache] Add a couple of invalidate methods
2018-04-20 11:12:50 -05:00
Joe Thornber
0f0eb04edb
[device/bcache] some more work on bcache
2018-04-20 11:12:50 -05:00
Joe Thornber
da7e13ef88
[lib/device/bcache] Tweaks after Kabi's review
2018-04-20 11:10:45 -05:00
Joe Thornber
acb42ec465
[device/bcache] Initial code drop.
...
Compiles. Not written tests yet.
2018-04-20 11:10:45 -05:00