Commit Graph

87 Commits

Author SHA1 Message Date
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
Justin Husted
d79d57ef89 Stop blkdev completion thread at process exit time, to make valgrind
happy.

Signed-off-by: Justin Husted <sigstop@gmail.com>
2019-11-03 23:17:43 -05:00
Justin Husted
97c6f60222 Stop workqueue threads at process exit time, to make valgrind happy.
Signed-off-by: Justin Husted <sigstop@gmail.com>
2019-11-03 23:17:43 -05:00
Justin Husted
b20e160735 Stop the timer task at process exit time, to make valgrind happy.
Signed-off-by: Justin Husted <sigstop@gmail.com>
2019-11-03 23:17:43 -05:00
Justin Husted
ff4d082246 Change preempt_disable() etc. to use a recursive mutex.
This is part of the userspace implementation of the kernel APIs for
bcachefs-tools. The previous implementation just provided a barrier, but
this isn't sufficient to make the associated percpu implementation safe.

Signed-off-by: Justin Husted <sigstop@gmail.com>
2019-11-03 23:17:43 -05:00
Justin Husted
e1ed5557bf Add valgrind handling: data read from io_submit was not being marked
properly. Manually mark it.

This might be better done by improving the valgrind wrapper for
io_submit.
2019-10-18 16:23:39 -04:00
Kent Overstreet
98b8f8d0c0 Update six locks 2019-10-01 15:55:42 -04:00
Kent Overstreet
db39aa3e1b Update bcachefs sources to 5a3a4087af bcachefs: Convert a BUG_ON() to a warning 2019-09-25 15:23:50 -04:00
Kent Overstreet
8192cc8ed8 Update llist code
This fixes a bug where the compiler was dropping a null ptr check
2019-08-28 11:35:00 -04:00
Kent Overstreet
f96ba8e0aa Update bcachefs sources to b91a514413 bcachefs: Don't try to delete stripes when RO 2019-07-11 12:00:51 -04:00
Kent Overstreet
0abf87f973 fix check for SYS_random 2019-04-10 17:37:00 -04:00
Kent Overstreet
d13bbb2955 Update bcachefs sources to d83b992f65 bcachefs: Rewrite journal_seq_blacklist machinery 2019-04-04 22:25:40 -04:00
Kent Overstreet
35fca2f044 Update bcachefs sources to 99750eab4d bcachefs: Persist stripe blocks_used 2019-01-23 15:53:32 -05:00
Kent Overstreet
8630059e6a Update bcachefs sources to bcca1c557b bcachefs: fixes for getting stuck flushing journal pins 2019-01-14 00:49:02 -05:00