Re: [PATCH 0/7] Move prefaulting into write slow paths

2025-01-29 Thread Kent Overstreet
On Wed, Jan 29, 2025 at 10:17:49AM -0800, Dave Hansen wrote: > tl;dr: The VFS and several filesystems have some suspect prefaulting > code. It is unnecessarily slow for the common case where a write's > source buffer is resident and does not need to be faulted in. > > Move these "prefaulting" oper

Re: [PATCH 11/21] bcachefs: improve the eytzinger0_find_le tests

2025-01-29 Thread Kent Overstreet
On Thu, Jan 30, 2025 at 12:17:51AM +0100, Andreas Gruenbacher wrote: > On Wed, Jan 29, 2025 at 10:30 PM Kent Overstreet > wrote: > > On Wed, Jan 29, 2025 at 10:21:31PM +0100, Andreas Gruenbacher wrote: > > > On Wed, Jan 29, 2025 at 9:28 PM Kent Overstreet > > > wrote: > > > > On Wed, Jan 29, 2025

Re: [PATCH 11/21] bcachefs: improve the eytzinger0_find_le tests

2025-01-29 Thread Andreas Gruenbacher
On Wed, Jan 29, 2025 at 10:30 PM Kent Overstreet wrote: > On Wed, Jan 29, 2025 at 10:21:31PM +0100, Andreas Gruenbacher wrote: > > On Wed, Jan 29, 2025 at 9:28 PM Kent Overstreet > > wrote: > > > On Wed, Jan 29, 2025 at 07:21:49PM +0100, Andreas Gruenbacher wrote: > > > > On Wed, Jan 29, 2025 at

Re: [PATCH 11/21] bcachefs: improve the eytzinger0_find_le tests

2025-01-29 Thread Kent Overstreet
On Wed, Jan 29, 2025 at 10:21:31PM +0100, Andreas Gruenbacher wrote: > On Wed, Jan 29, 2025 at 9:28 PM Kent Overstreet > wrote: > > On Wed, Jan 29, 2025 at 07:21:49PM +0100, Andreas Gruenbacher wrote: > > > On Wed, Jan 29, 2025 at 7:04 PM Kent Overstreet > > > wrote: > > > > On Tue, Jan 28, 2025

Re: [PATCH 11/21] bcachefs: improve the eytzinger0_find_le tests

2025-01-29 Thread Andreas Gruenbacher
On Wed, Jan 29, 2025 at 9:28 PM Kent Overstreet wrote: > On Wed, Jan 29, 2025 at 07:21:49PM +0100, Andreas Gruenbacher wrote: > > On Wed, Jan 29, 2025 at 7:04 PM Kent Overstreet > > wrote: > > > On Tue, Jan 28, 2025 at 05:38:48PM +0100, Andreas Gruenbacher wrote: > > > > Rename eytzinger0_find_te

[PATCH] bcachefs: BCH_IOCTL_QUERY_COUNTERS

2025-01-29 Thread Kent Overstreet
Add an ioctl for querying counters, the same ones provided in /sys/fs/bcachefs//counters/, but more suitable for a 'bcachefs top' command. Signed-off-by: Kent Overstreet --- fs/bcachefs/bcachefs_ioctl.h | 10 ++ fs/bcachefs/chardev.c| 32 fs/bcach

[PATCH] bcachefs: bch2_bkey_sectors_need_rebalance() now only depends on bch_extent_rebalance

2025-01-29 Thread Kent Overstreet
Previously, bch2_bkey_sectors_need_rebalance() called bch2_target_accepts_data(), checking whether the target is writable. However, this means that adding or removing devices from a target would change the value of bch2_bkey_sectors_need_rebalance() for an existing extent; this needs to be invaria

[PATCH] bcachefs: Fix discard path journal flushing

2025-01-29 Thread Kent Overstreet
The discard path is supposed to issue journal flushes when there's too many buckets empty buckets that need a journal commit before they can be written to again, but at some point this code seems to have been lost. Bring it back with a new optimization to make sure we don't issue too many journal

Re: [PATCH 11/21] bcachefs: improve the eytzinger0_find_le tests

2025-01-29 Thread Kent Overstreet
On Wed, Jan 29, 2025 at 07:21:49PM +0100, Andreas Gruenbacher wrote: > On Wed, Jan 29, 2025 at 7:04 PM Kent Overstreet > wrote: > > On Tue, Jan 28, 2025 at 05:38:48PM +0100, Andreas Gruenbacher wrote: > > > Rename eytzinger0_find_test_val() to eytzinger0_find_test_le() and add a > > > new eytzinge

[GIT PULL] bcachefs fixes for 6.14-rc1

2025-01-29 Thread Kent Overstreet
Hi Linus, just some small stuff. users seeing specific (reproducable) performance issues should ping me, I have some new tools for tracking those down The following changes since commit ff0b7ed607e779f0e109f7f24388e0ce07af2ebe: bcachefs: Fix check_inode_hash_info_matches_root() (2025-01-15 15:

Re: [PATCH 11/21] bcachefs: improve the eytzinger0_find_le tests

2025-01-29 Thread Andreas Gruenbacher
On Wed, Jan 29, 2025 at 7:04 PM Kent Overstreet wrote: > On Tue, Jan 28, 2025 at 05:38:48PM +0100, Andreas Gruenbacher wrote: > > Rename eytzinger0_find_test_val() to eytzinger0_find_test_le() and add a > > new eytzinger0_find_test_val() wrapper that calls it. > > > > We have already established t

[PATCH 5/7] bcachefs: Move prefaulting out of hot write path

2025-01-29 Thread Dave Hansen
From: Dave Hansen Prefaulting the write source buffer incurs an extra userspace access in the common fast path. Make bch2_buffered_write() consistent with generic_perform_write(): only touch userspace an extra time when copy_page_from_iter_atomic() has failed to make progress. This also zaps a

[PATCH 0/7] Move prefaulting into write slow paths

2025-01-29 Thread Dave Hansen
tl;dr: The VFS and several filesystems have some suspect prefaulting code. It is unnecessarily slow for the common case where a write's source buffer is resident and does not need to be faulted in. Move these "prefaulting" operations to slow paths where they ensure forward progress but they do not

Re: [PATCH 11/21] bcachefs: improve the eytzinger0_find_le tests

2025-01-29 Thread Kent Overstreet
On Tue, Jan 28, 2025 at 05:38:48PM +0100, Andreas Gruenbacher wrote: > Rename eytzinger0_find_test_val() to eytzinger0_find_test_le() and add a > new eytzinger0_find_test_val() wrapper that calls it. > > We have already established that the array is sorted in eytzinger order, > so we can use the e

Re: [PATCH 20/21] bcachefs: convert eytzinger sort to be 1-based (2)

2025-01-29 Thread Kent Overstreet
On Tue, Jan 28, 2025 at 05:38:57PM +0100, Andreas Gruenbacher wrote: > In this second step, transform the eytzinger indexes i, j, and k in > eytzinger1_sort_r() from 0-based to 1-based. This step looks a bit > messy, but the resulting code is slightly better. I really hate the cute and paste of l

Re: [PATCH] bcachefs: fix deadlock in journal_entry_open()

2025-01-29 Thread Kent Overstreet
On Thu, Jan 30, 2025 at 02:17:44AM +0900, Jeongjun Park wrote: > In the previous commit b3d82c2f2761, code was added to prevent journal > sequence > overflow. Among them, the code added to journal_entry_open() uses the > bch2_fs_fatal_err_on() function to handle errors. > > However, __journal_res

[PATCH] bcachefs: fix deadlock in journal_entry_open()

2025-01-29 Thread Jeongjun Park
In the previous commit b3d82c2f2761, code was added to prevent journal sequence overflow. Among them, the code added to journal_entry_open() uses the bch2_fs_fatal_err_on() function to handle errors. However, __journal_res_get() , which calls journal_entry_open() , calls journal_entry_open() while

Re: [PATCH 01/21] bcachefs: remove dead code in is_aligned

2025-01-29 Thread Andreas Gruenbacher
On Wed, Jan 29, 2025 at 11:32 AM Eric Herman wrote: > Hello Andreas, > > On 2025-01-28 17:38, Andreas Gruenbacher wrote: > > This statement does nothing. > > I would suggest this statement does nothing only in the case of #ifndef > CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS. > > In the case where CONF

Re: [PATCH 01/21] bcachefs: remove dead code in is_aligned

2025-01-29 Thread Eric Herman
Hello Andreas, On 2025-01-28 17:38, Andreas Gruenbacher wrote: This statement does nothing. I would suggest this statement does nothing only in the case of #ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS. In the case where CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS _is_ defined, it tells the co

[syzbot] [bcachefs?] KMSAN: uninit-value in btree_interior_update_work

2025-01-29 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:ab18b8fff124 Merge tag 'auxdisplay-v6.14-1' of git://git.k.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=13a4756458 kernel config: https://syzkaller.appspot.com/x/.config?x=ac8df499d47c7efd das