summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-11-07todobtree-key-cacheKent Overstreet
2020-11-07fooKent Overstreet
2020-11-07bcachefs: drop .write_inode methodKent Overstreet
This shouldn't be needed for anything anymore - all inode updates are done internally by bcachefs code, and done by updating the inode in the btree directly. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-07bcachefs: Kill ei_update_lockKent Overstreet
All uses are now covered by either the normal inode lock, or the btree inode lock. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-07change bch2_dirent_lookupKent Overstreet
2020-11-07lockdep: debug_check_lock_not_held()Kent Overstreet
2020-11-07bcachefs: Make workqueues unboundKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-07TODOKent Overstreet
2020-11-07print hash table max chainKent Overstreet
2020-11-07bcachefs: new resizable hash tablesKent Overstreet
2020-11-07disable flush/fua & time statsKent Overstreet
2020-11-07more prefetchingKent Overstreet
2020-11-07aux search tree debugKent Overstreet
2020-11-07don't inline bset_search_tree()Kent Overstreet
2020-11-07have aux search tree lookup return a rangeKent Overstreet
2020-11-07bcachefs: Fix btree iterator leakKent Overstreet
this fixes an occasonial btree transaction iterators overflow. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-07bcachefs: Inline make_bfloat() into __build_ro_aux_tree()Kent Overstreet
This is a fast path - also, lift out the checks/init for min/max key. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-07bcachefs: use a radix tree for inum bitmap in fsckKent Overstreet
The change to use the cpu nr for the high bits of new inode numbers means that inode numbers are very space - we see -ENOMEM during fsck without this. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-07bcachefs: New varintsKent Overstreet
Previous varint implementation used by the inode code was not nearly as fast as it could have been; partly because it was attempting to encode integers up to 96 bits (for timestamps) but this meant that encoding and decoding the length required a table lookup. Instead, we'll just encode timestamps greater than 64 bits as two separate varints; this will make decoding/encoding of inodes significantly faster overall. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-07bcachefs: Fix build warning when CONFIG_BCACHEFS_DEBUG=nKent Overstreet
this function is only used by debug code, but we'd like to always build it so we know that it does build. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-07bcachefs: Drop typechecking from bkey_cmp_packed()Kent Overstreet
This only did anything in two places, and those can just be replaced wiht bkey_cmp_left_packed()). Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-06bcachefs: More inlinining in the btree key cache codeKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-05bcachefs: Fix spurious transaction restartsKent Overstreet
The checks for lock ordering violations weren't quite right. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-05bcachefs: Add a single slot percpu buf for btree itersKent Overstreet
Allocating our array of btree iters is a big enough allocation that it hits the buddy allocator, and we're seeing lots of lock contention. Sticking a single element buffer in front of it should help. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-05bcachefs: Convert to readaheadMatthew Wilcox (Oracle)
Use the new readahead method instead of readpages. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
2020-11-05bcachefs: Use attach_page_private and detach_page_privateMatthew Wilcox (Oracle)
These recently added helpers simplify the code. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
2020-11-05bcachefs: Remove page_state_init_for_readMatthew Wilcox (Oracle)
This is dead code; delete the function. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
2020-11-05bcachefs: Build fixes for 32bit x86Kent Overstreet
PAGE_SIZE and size_t are not unsigned longs on 32 bit, annoying... also switch to atomic64_cmpxchg instead of cmpxchg() for journal_seq_copy, as atomic64_cmpxchg has a fallback that uses spinlocks for when it's not supported. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-05bcachefs: Delete memcpy() macroKent Overstreet
This checks for overlapping src and dst in debug mode (i.e. should have used memmove) - kasan should be checking for this now. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-05bcachefs: Improved inode create optimizationKent Overstreet
This shards new inodes into different btree nodes by using the processor ID for the high bits of the new inode number. Much faster than the previous inode create optimization - this also helps with sharding in the other btrees that index by inode number. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-05bcachefs: Report inode counts via statfsKent Overstreet
Took awhile to figure out exactly what statfs wanted... Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-05bcachefs: add const annotations to bset.cKent Overstreet
perhaps a bit silly, but some debug assertions we want to add need const propagated a bit more. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-05bcachefs: Don't embed btree iters in btree_transKent Overstreet
These haven't been in used since reallocing iterators has been disabled, and saves us a lot of stack if we get rid of it. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-05bcachefs: Split out debug_check_btree_accountingKent Overstreet
This check is very expensive Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-05bcachefs: Drop sysfs interface to debug parametersKent Overstreet
It's not used much anymore, the module paramter interface is better. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-05bcachefs: Minor journal reclaim improvementKent Overstreet
With the btree key cache code, journal reclaim now has a lot more work to do. It could be the case that after journal reclaim has finished one iteration there's already more work to do, so put it in a loop to check for that. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-05bcachefs: Inode create optimizationKent Overstreet
On workloads that do a lot of multithreaded creates all at once, lock contention on the inodes btree turns out to still be an issue. This patch adds a small buffer of inode numbers that are known to be free, so that we can avoid touching the btree on every create. Also, this changes inode creates to update via the btree key cache for the initial create. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-05bcachefs: Improve check for when bios are physically contiguousKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-05bcachefs: Fix spurious transaction restartsKent Overstreet
The check for whether locking a btree node would deadlock was wrong - we have to check that interior nodes are locked before descendents, but this check was wrong when consider cached vs. non cached iterators. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-05bcachefs: Improve tracing for transaction restartsKent Overstreet
We have a bug where we can get stuck with a process spinning in transaction restarts - need more information. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-05bcachefs: Fix stack corruptionKent Overstreet
A bkey_on_stack_realloc() call was in the wrong place, and broken for indirect extents Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-05bcachefs: Use cached iterators for inode updatesKent Overstreet
This switches inode updates to use cached btree iterators - which should be a nice performance boost, since lock contention on the inodes btree can be a bottleneck on multithreaded workloads. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-05bcachefs: fiemap fixesKent Overstreet
- fiemap didn't know about inline extents, fixed - advancing to the next extent after we'd chased a pointer to the reflink btree was wrong, fixed Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-05bcachefs: Fix btree updates when mixing cached and non cached iteratorsKent Overstreet
There was a bug where bch2_trans_update() would incorrectly delete a pending update where the new update did not actually overwrite the existing update, because we were incorrectly using BTREE_ITER_TYPE when sorting pending btree updates. This affects the pending patch to use cached iterators for inode updates. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-05bcachefs: Add mode to bch2_inode_to_textKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-05bcachefs: Always write a journal entry when stopping journalKent Overstreet
This is to fix a (harmless) bug where the read clock hand in the superblock doesn't match the journal. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-05bcachefs: Drop alloc keys from journal when -o reconstruct_allocKent Overstreet
This fixes a bug where we'd pop an assertion due to replaying a key for an interior btree node when that node no longer exists. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-05bcachefs: Indirect inline data extentsKent Overstreet
When inline data extents were added, reflink was forgotten about - we need indirect inline data extents for reflink + inline data to work correctly. This patch adds them, and a new feature bit that's flipped when they're used. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-05bcachefs: Fix rare use after free in read pathKent Overstreet
If the bkey_on_stack_reassemble() call in __bch2_read_indirect_extent() reallocates the buffer, k in bch2_read - which we pointed at the bkey_on_stack buffer - will now point to a stale buffer. Whoops. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2020-11-05bcachefs: Improve some error messagesKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>