Hi
Here I'm sending a small compile fix for bcachefs-tools.
Without this patch, I get this error:
cargo build --release --manifest-path rust-src/Cargo.toml
Compiling bch_bindgen v0.1.0
(/usr/src/git/bcachefs-tools/rust-src/bch_bindgen)
error: failed to run custom build command for `bch_bindgen v0.1.0
(/usr/src/git/bcachefs-tools/rust-src/bch_bindgen)`
Caused by:
process didn't exit successfully:
`/usr/src/git/bcachefs-tools/rust-src/target/release/build/bch_bindgen-733e88995ce9eab7/build-script-build`
(exit status: 101)
--- stderr
warning: optimization flag '-fkeep-inline-functions' is not supported
[-Wignored-optimization-argument]
../../include/linux/bit_spinlock.h:20:3: error: call to undeclared
function 'futex'; ISO C99 and later do not support implicit function
declarations [-Wimplicit-function-declaration]
../../include/linux/bit_spinlock.h:28:2: error: call to undeclared
function 'futex'; ISO C99 and later do not support implicit function
declarations [-Wimplicit-function-declaration]
../../include/linux/bit_spinlock.h:39:2: error: call to undeclared
function 'futex'; ISO C99 and later do not support implicit function
declarations [-Wimplicit-function-declaration]
The futex() function is declared in
/usr/include/x86_64-linux-gnu/urcu/futex.h
It is not declared in linux/futex.h, so we need to include urcu/futex.h
Mikulas
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
cpu_relax() is supposed to be a compiler barrier - this fixes a bug with
btree_write_buffer_flush() getting stuck.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
- Spin up a background thread to call the shrinkers every 1 second
- Memory allocations will only call reclaim after a failed allocation,
not every single time
This will be a major performance boost on allocation intensive
workloads.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
The musl C library does not define __attribute_const__. Add it to
include/linux/compiler.h with a guard to fix build against musl libc.
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
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>
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>
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>
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>