Commit Graph

100 Commits

Author SHA1 Message Date
Kent Overstreet
188b6d0c8e Update bcachefs sources to cd779e0cc5 bcachefs: Skip inode unpack/pack in bch2_extent_update() 2022-10-22 14:41:54 -04:00
Kent Overstreet
e0a51ccce8 Update bcachefs sources to 3e93567c51 bcachefs: Switch to local_clock() for fastpath time source 2022-10-15 01:04:30 -04:00
Kent Overstreet
e66011cd2c Update bcachefs sources to 6dc2a699c6 bcachefs: bch2_path_put_nokeep() 2022-10-11 06:40:30 -04:00
Kent Overstreet
81aef33957 Don't run shrinkers without GFP_KERNEL
This would correspond to GFP_RECLAIM in the kernel - but we don't
distinguish between different types of reclaim here.

This solves a deadlock in the btree node memory allocation path - we
allocate with the btree node cache lock held but without GFP_KERNEL set.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2022-10-11 00:39:06 -04:00
Kent Overstreet
72add8822c Update bcachefs sources to 47ffed9fad bcachefs: bch2_btree_delete_range_trans() now uses peek_upto() 2022-10-10 00:10:45 -04:00
Kent Overstreet
8d6138baac Update bcachefs sources to cbccc6d869 bcachefs: Ratelimit ec error message 2022-10-09 02:33:05 -04:00
Kent Overstreet
99caca2c70 Update bcachefs sources to 24c6361e20 bcachefs: Fix a trans path overflow in bch2_btree_delete_range_trans()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2022-09-28 11:41:03 -04:00
Kent Overstreet
d01f633041 Update bcachefs sources to 176718966e bcachefs: Re-enable hash_redo_key() 2022-09-04 14:42:05 -04:00
Kent Overstreet
dded444b20 Update bcachefs sources to dfaf9a6ee2 lib/printbuf: Clean up headers 2022-08-18 12:49:48 -04:00
Kent Overstreet
ddac1641ee Update bcachefs sources to 90a9c61e2b bcachefs: Switch bch2_btree_delete_range() to bch2_trans_run() 2022-08-11 17:34:34 -04:00
Kent Overstreet
b4afc1fa26 Fix bdev_logical_block_size()
We were returning sectors instead of bytes.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2022-06-22 22:17:14 -04:00
Kent Overstreet
23dc00de78 Fix printk_ratelimited()
printk_ratelimited was behind an #ifdef CONFIG_PRINTK, which we don't
define, so it was a complete noop - oops.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2022-06-22 22:05:39 -04:00
Kent Overstreet
03b8098d37 cmd_dump: Use buffered IO for reading device metadata
We're reading device metadat in mostly sequential order - buffered IO
will be faster than O_DIRECT.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2022-06-18 18:33:25 -04:00
Kent Overstreet
6ac37db841 Update bcachefs sources to 24f7e08cd8 bcachefs: shrinker.to_text() methods 2022-06-09 15:07:25 -04:00
Kent Overstreet
46b2c553aa Update bcachefs sources to fad6d13aa5 fixup! bcachefs: Add persistent counters 2022-05-30 23:24:10 -04:00
Kent Overstreet
986533d8d5 Update bcachefs sources to 6ddf061e68 bcachefs: Use a genradix for reading journal entries 2022-04-08 19:26:30 -04:00
Kent Overstreet
c5183ea57f Heap code fix
When deleting an entry from a heap that was at entry h->used - 1, we'd
end up calling heap_sift() on an entry outside the heap - the entry we
just removed - which would end up re-adding it to the heap and deleting
something we didn't want to delete. Oops...

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2022-03-28 12:39:12 -04:00
Kent Overstreet
1a9d73b5c0 Shrinker improvements
After memory allocation failure, don't rely on /proc/meminfo to figure
out how much memory we should free - instead unconditionally free 1/8th
of each cache.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2022-03-21 20:20:09 -04:00
Kent Overstreet
205d75307a Better bio_alloc_bioset()
bio_alloc_bioset() now uses mempools, so we don't segfault on memory
allocation failure.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2022-03-21 18:21:31 -04:00
Kent Overstreet
d34e731082 Update bcachefs sources to e48731a188 bcachefs: Fix BTREE_TRIGGER_WANTS_OLD_AND_NEW 2022-03-13 19:20:59 -04:00
Kent Overstreet
a1d66a2a4e Update bcachefs sources to ba398d2906 bcachefs: Fix reflink repair code 2022-02-13 04:08:33 -05:00
Kent Overstreet
42ba8b5a75 Update bcachefs sources to 5fd0c70102 bcachefs: Fix __remove_dirent() 2021-11-03 21:28:23 -04:00
Brett Holman
2de72a59e0 Fix 32 bit io regression
In commit ba1dbafc1f I reverted 9942fc82d4, which was a workaround
for an upstream 32bit libaio bug. Oops.

Signed-off-by: Brett Holman <bholman.devel@gmail.com>
2021-10-16 18:28:49 -06:00
Brett Holman
ba1dbafc1f Fall back to synchronous io when kernel doesn't support aio.
Signed-off-by: Brett Holman <bholman.devel@gmail.com>
2021-10-10 15:23:57 -06:00
Kent Overstreet
2225e9a372 Correctly print out error from io_setup()
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2021-10-09 16:20:28 -04:00
Brett Holman
9942fc82d4 Make aio code use struct io_iocb_common to support 32 bit architectures
Signed-off-by: Brett Holman <bholman.devel@gmail.com>
2021-09-22 17:58:09 -04:00
Kent Overstreet
347c0b108e Update bcachefs sources to dbee44d5ab bcachefs: add bcachefs xxhash support 2021-07-07 20:30:53 -04:00
Kent Overstreet
55142cd0b5 Update bcachefs sources to ca3cfad39f fixup! bcachefs: Improve iter->should_be_locked 2021-06-23 15:53:37 -04:00
jpsollie
d228e43048 Cleanup Makefile for better compatibility + enable "make debug"
- clean up Makefile to improve compiler compatibility
- add a "Make debug" target for easier debug builds
- update INSTALL
- fix six.c when running "make debug" against GCC 9 (maybe-uninitialized)

Signed-off by: Janpieter Sollie <janpieter.sollie@edpnet.be>
2021-06-13 01:14:47 -04:00
Kent Overstreet
58ae103b0a Update bcachefs sources to e3a7cee503 bcachefs: Don't mark superblocks past end of usable space 2021-06-08 22:55:14 -04:00
Justin Husted
f6d87e9a87 Work around build error with gcc <10
linux/six.c: In function ‘__six_lock_type_slowpath’:
linux/six.c:73:6: error: ‘old.<U81c8>.v’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

Signed-off-by: Justin Husted <sigstop@gmail.com>
2021-06-05 02:15:22 -07:00
Kent Overstreet
4a2acdaf65 Update closures from kernel source tree 2021-05-27 21:13:52 -04:00
Kent Overstreet
bb74624daa Update bcachefs sources to a5c0e1bb30 bcachefs: Clean up bch2_btree_and_journal_walk() 2021-04-30 18:23:38 -04:00
Kent Overstreet
30f72f75f5 Add a real mempool implementation
Imported from the kernel.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2021-04-24 01:36:43 -04:00
Kent Overstreet
209695dedf Update bcachefs sources to f26267fc82 bcachefs: kill bset_tree->max_key 2021-04-04 22:15:29 -04:00
Kent Overstreet
98844616f6 If we failed to read /proc/meminfo, just run the shrinkers. 2021-03-31 13:04:34 -04:00
Kent Overstreet
a2094890a9 Update bcachefs sources to 18686af684 bcachefs: Inode backpointers 2021-03-29 00:22:38 -04:00
Kent Overstreet
c88113e255 Update bcachefs sources to ad68801b93 bcachefs: Use pcpu mode of six locks for interior nodes 2021-03-24 22:13:00 -04:00
Kent Overstreet
fb2d506f6f Don't die in kthread_create()
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2021-02-24 00:41:09 -05:00
Kent Overstreet
c28f93bc52 generix radix trees: Don't overflow in peek() 2021-02-12 21:42:46 -05:00
Kent Overstreet
c1dcd67f7d Don't use mlockall()
We're hitting -ENOMEM while running fsck - we appear to need memory
overcommit, which mlockall() disables.
2021-01-12 16:36:45 -05:00
Kent Overstreet
cd9892e543 Update bcachefs sources to 10ab39f2fa bcachefs: Improvements to the journal read error paths 2020-08-24 16:25:05 -04:00
Kent Overstreet
05408b6f8f Update bcachefs sources to 4837f82ee1 bcachefs: Use cached iterators for alloc btree 2020-06-15 16:27:19 -04:00
Kent Overstreet
1952c0790c Update bcachefs sources to c9b4a210f9 fixup! bcachefs: Fixes for going RO 2020-06-03 19:56:33 -04:00
Kent Overstreet
34c9be19b3 Update bcachefs sources to e1f6739c4a bcachefs: Fix another iterator counting bug 2020-05-14 21:48:52 -04:00
Yuxuan Shui
5bc48bd428
Fix building on musl
* Add missing linux/stddef.h includes
* Explicitly cast PAGE_SIZE to size_t. PAGE_SIZE is defined without UL
  suffix in musl
* Musl doesn't define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP, so
  initialize the mutexes with pthread_once.
2020-05-05 10:29:31 +01:00
Justin Husted
d0b5ee0339 Increase stack size of userspace threads to 32k.
Certain fuse tests crashed inside of libc calls such as fprintf() with
only 16k of stack.

Signed-off-by: Justin Husted <sigstop@gmail.com>
2019-12-14 16:51:54 -08:00
Kent Overstreet
f712a866a4 Put valgrind support behind CONFIG_VALGRIND 2019-12-04 17:49:34 -05:00
Justin Husted
5337ad4a43 Make userspace blkdev cleanup code more robust.
The existing cleanup code would silently cancel disk IO requests, if
somehow the calling code did not wait for completion.  This code now
tracks requests and will bug if any are lost.

Signed-off-by: Justin Husted <sigstop@gmail.com>
2019-11-07 18:58:32 -08:00
Justin Husted
76e147d0a9 Fix refcount bug in blkdev and timer kthreads.
The shutdown code in d79d57e and b20e160 had a race condition during
shutdown, due to not owning a reference on the associated task_struct
while the associated threads shut themselves down.

Patch over this by taking an appropriate reference.

Signed-off-by: Justin Husted <sigstop@gmail.com>
2019-11-07 16:44:04 -08:00