diff options
Diffstat (limited to 'meta/recipes-kernel/lttng/lttng-modules/0005-Fix-btrfs_get_extent-flags-and-compress_type-changed.patch')
-rw-r--r-- | meta/recipes-kernel/lttng/lttng-modules/0005-Fix-btrfs_get_extent-flags-and-compress_type-changed.patch | 88 |
1 files changed, 0 insertions, 88 deletions
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0005-Fix-btrfs_get_extent-flags-and-compress_type-changed.patch b/meta/recipes-kernel/lttng/lttng-modules/0005-Fix-btrfs_get_extent-flags-and-compress_type-changed.patch deleted file mode 100644 index 65c33dafef..0000000000 --- a/meta/recipes-kernel/lttng/lttng-modules/0005-Fix-btrfs_get_extent-flags-and-compress_type-changed.patch +++ /dev/null | |||
@@ -1,88 +0,0 @@ | |||
1 | From 86db094386b43bb5c6b47552f9a4826ca8ba917d Mon Sep 17 00:00:00 2001 | ||
2 | From: Kienan Stewart <kstewart@efficios.com> | ||
3 | Date: Mon, 22 Jan 2024 13:13:36 -0500 | ||
4 | Subject: [PATCH 5/5] Fix: btrfs_get_extent flags and compress_type changed in | ||
5 | linux 6.8.0-rc1 | ||
6 | |||
7 | See upstream commit: | ||
8 | |||
9 | commit f86f7a75e2fb5fd7d31d00eab8a392f97ba42ce9 | ||
10 | Author: Filipe Manana <fdmanana@suse.com> | ||
11 | Date: Mon Dec 4 16:20:33 2023 +0000 | ||
12 | |||
13 | btrfs: use the flags of an extent map to identify the compression type | ||
14 | |||
15 | Currently, in struct extent_map, we use an unsigned int (32 bits) to | ||
16 | identify the compression type of an extent and an unsigned long (64 bits | ||
17 | on a 64 bits platform, 32 bits otherwise) for flags. We are only using | ||
18 | 6 different flags, so an unsigned long is excessive and we can use flags | ||
19 | to identify the compression type instead of using a dedicated 32 bits | ||
20 | field. | ||
21 | |||
22 | We can easily have tens or hundreds of thousands (or more) of extent maps | ||
23 | on busy and large filesystems, specially with compression enabled or many | ||
24 | or large files with tons of small extents. So it's convenient to have the | ||
25 | extent_map structure as small as possible in order to use less memory. | ||
26 | |||
27 | So remove the compression type field from struct extent_map, use flags | ||
28 | to identify the compression type and shorten the flags field from an | ||
29 | unsigned long to a u32. This saves 8 bytes (on 64 bits platforms) and | ||
30 | reduces the size of the structure from 136 bytes down to 128 bytes, using | ||
31 | now only two cache lines, and increases the number of extent maps we can | ||
32 | have per 4K page from 30 to 32. By using a u32 for the flags instead of | ||
33 | an unsigned long, we no longer use test_bit(), set_bit() and clear_bit(), | ||
34 | but that level of atomicity is not needed as most flags are never cleared | ||
35 | once set (before adding an extent map to the tree), and the ones that can | ||
36 | be cleared or set after an extent map is added to the tree, are always | ||
37 | performed while holding the write lock on the extent map tree, while the | ||
38 | reader holds a lock on the tree or tests for a flag that never changes | ||
39 | once the extent map is in the tree (such as compression flags). | ||
40 | |||
41 | Upstream-Status: Backport [Uhttps://review.lttng.org/c/lttng-modules/+/11700] | ||
42 | |||
43 | Change-Id: I95402d43f064c016b423b48652e4968d3db9b8a9 | ||
44 | Signed-off-by: Kienan Stewart <kstewart@efficios.com> | ||
45 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
46 | --- | ||
47 | include/instrumentation/events/btrfs.h | 25 ++++++++++++++++++++++++- | ||
48 | 1 file changed, 24 insertions(+), 1 deletion(-) | ||
49 | |||
50 | diff --git a/include/instrumentation/events/btrfs.h b/include/instrumentation/events/btrfs.h | ||
51 | index a2a412b..ffb1b64 100644 | ||
52 | --- a/include/instrumentation/events/btrfs.h | ||
53 | +++ b/include/instrumentation/events/btrfs.h | ||
54 | @@ -177,7 +177,30 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_evict, | ||
55 | ) | ||
56 | #endif | ||
57 | |||
58 | -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0)) | ||
59 | +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,8,0)) | ||
60 | + | ||
61 | +LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, | ||
62 | + | ||
63 | + TP_PROTO(const struct btrfs_root *root, const struct btrfs_inode *inode, | ||
64 | + const struct extent_map *map), | ||
65 | + | ||
66 | + TP_ARGS(root, inode, map), | ||
67 | + | ||
68 | + TP_FIELDS( | ||
69 | + ctf_integer(u64, root_objectid, root->root_key.objectid) | ||
70 | + ctf_integer(u64, ino, btrfs_ino(inode)) | ||
71 | + ctf_integer(u64, start, map->start) | ||
72 | + ctf_integer(u64, len, map->len) | ||
73 | + ctf_integer(u64, orig_start, map->orig_start) | ||
74 | + ctf_integer(u64, block_start, map->block_start) | ||
75 | + ctf_integer(u64, block_len, map->block_len) | ||
76 | + ctf_integer(unsigned int, flags, map->flags) | ||
77 | + ctf_integer(int, refs, refcount_read(&map->refs)) | ||
78 | + ctf_integer(unsigned int, compress_type, extent_map_compression(map)) | ||
79 | + ) | ||
80 | +) | ||
81 | + | ||
82 | +#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0)) | ||
83 | |||
84 | LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, | ||
85 | |||
86 | -- | ||
87 | 2.39.2 | ||
88 | |||