diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-11-24 18:03:55 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:49 -0400 |
commit | 393a1f6863790fddf8b53bfb81f2c984cdbc1990 (patch) | |
tree | 49d028ee32ff607fcc69bf16aba948463d4a91cd /fs/bcachefs/io.c | |
parent | 19a614d2e4beed7faf52ab95cb48ce38a3c38c04 (diff) | |
download | lwn-393a1f6863790fddf8b53bfb81f2c984cdbc1990.tar.gz lwn-393a1f6863790fddf8b53bfb81f2c984cdbc1990.zip |
bcachefs: Better inlining in core write path
Provide inline versions of some allocation functions
- bch2_alloc_sectors_done_inlined()
- bch2_alloc_sectors_append_ptrs_inlined()
and use them in the core IO path.
Also, inline bch2_extent_update_i_size_sectors() and
bch2_bkey_append_ptr().
In the core write path, function call overhead matters - every function
call is a jump to a new location and a potential cache miss.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/io.c')
-rw-r--r-- | fs/bcachefs/io.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/bcachefs/io.c b/fs/bcachefs/io.c index c39f00f9ebd8..0c264266f466 100644 --- a/fs/bcachefs/io.c +++ b/fs/bcachefs/io.c @@ -832,7 +832,7 @@ static void init_append_extent(struct bch_write_op *op, crc.nonce) bch2_extent_crc_append(&e->k_i, crc); - bch2_alloc_sectors_append_ptrs(op->c, wp, &e->k_i, crc.compressed_size, + bch2_alloc_sectors_append_ptrs_inlined(op->c, wp, &e->k_i, crc.compressed_size, op->flags & BCH_WRITE_CACHED); bch2_keylist_push(&op->insert_keys); @@ -1275,7 +1275,7 @@ again: bch2_open_bucket_get(c, wp, &op->open_buckets); ret = bch2_write_extent(op, wp, &bio); - bch2_alloc_sectors_done(c, wp); + bch2_alloc_sectors_done_inlined(c, wp); err: if (ret <= 0) { if (!(op->flags & BCH_WRITE_SYNC)) { |