diff options
author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2024-08-07 10:58:22 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-08-08 14:28:49 +0100 |
commit | 5f273feeba21661fd8038ad58c96f4030fae4d96 (patch) | |
tree | 6eeb24172c337cdcec5138ec8c85a921b7e474a5 | |
parent | ae85f8d5a07a03977735bde158cea3afa198e892 (diff) | |
download | poky-5f273feeba21661fd8038ad58c96f4030fae4d96.tar.gz |
lttng-modules: backport patches for kernel v6.11
While we wait for a new lttng-release, we backport 6
patches to fix the build against the 6.11 kernel.
(From OE-Core rev: 168e98c7d2118333da9450f069699128892e70db)
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
7 files changed, 500 insertions, 0 deletions
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0001-Fix-kfree_skb-changed-in-6.11-rc1.patch b/meta/recipes-kernel/lttng/lttng-modules/0001-Fix-kfree_skb-changed-in-6.11-rc1.patch new file mode 100644 index 0000000000..83b753994e --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0001-Fix-kfree_skb-changed-in-6.11-rc1.patch | |||
@@ -0,0 +1,65 @@ | |||
1 | From 9706d0431c9cc4178db4cf630fee6f5f85f2543e Mon Sep 17 00:00:00 2001 | ||
2 | From: Kienan Stewart <kstewart@efficios.com> | ||
3 | Date: Mon, 29 Jul 2024 14:01:18 +0000 | ||
4 | Subject: [PATCH 1/6] Fix: kfree_skb changed in 6.11-rc1 | ||
5 | |||
6 | See upstream commit: | ||
7 | |||
8 | commit c53795d48ee8f385c6a9e394651e7ee914baaeba | ||
9 | Author: Yan Zhai <yan@cloudflare.com> | ||
10 | Date: Mon Jun 17 11:09:04 2024 -0700 | ||
11 | |||
12 | net: add rx_sk to trace_kfree_skb | ||
13 | |||
14 | skb does not include enough information to find out receiving | ||
15 | sockets/services and netns/containers on packet drops. In theory | ||
16 | skb->dev tells about netns, but it can get cleared/reused, e.g. by TCP | ||
17 | stack for OOO packet lookup. Similarly, skb->sk often identifies a local | ||
18 | sender, and tells nothing about a receiver. | ||
19 | |||
20 | Allow passing an extra receiving socket to the tracepoint to improve | ||
21 | the visibility on receiving drops. | ||
22 | |||
23 | Upstream-Status: Backport | ||
24 | |||
25 | Change-Id: I33c8ce1a48006456f198ab1592f733b55be01016 | ||
26 | Signed-off-by: Kienan Stewart <kstewart@efficios.com> | ||
27 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
28 | --- | ||
29 | include/instrumentation/events/skb.h | 20 +++++++++++++++++++- | ||
30 | 1 file changed, 19 insertions(+), 1 deletion(-) | ||
31 | |||
32 | diff --git a/include/instrumentation/events/skb.h b/include/instrumentation/events/skb.h | ||
33 | index edfda7ff..0b5a95dc 100644 | ||
34 | --- a/include/instrumentation/events/skb.h | ||
35 | +++ b/include/instrumentation/events/skb.h | ||
36 | @@ -43,7 +43,25 @@ LTTNG_TRACEPOINT_ENUM(skb_drop_reason, | ||
37 | ) | ||
38 | #endif | ||
39 | |||
40 | -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0) \ | ||
41 | +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,11,0)) | ||
42 | +LTTNG_TRACEPOINT_EVENT_MAP(kfree_skb, | ||
43 | + | ||
44 | + skb_kfree, | ||
45 | + | ||
46 | + TP_PROTO(struct sk_buff *skb, void *location, | ||
47 | + enum skb_drop_reason reason, struct sock *rx_sk), | ||
48 | + | ||
49 | + TP_ARGS(skb, location, reason, rx_sk), | ||
50 | + | ||
51 | + TP_FIELDS( | ||
52 | + ctf_integer_hex(void *, skbaddr, skb) | ||
53 | + ctf_integer_hex(void *, location, location) | ||
54 | + ctf_integer_network(unsigned short, protocol, skb->protocol) | ||
55 | + ctf_enum(skb_drop_reason, uint8_t, reason, reason) | ||
56 | + ctf_integer_hex(void *, rx_skaddr, rx_sk) | ||
57 | + ) | ||
58 | +) | ||
59 | +#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0) \ | ||
60 | || LTTNG_KERNEL_RANGE(5,15,58, 5,16,0) \ | ||
61 | || LTTNG_RHEL_KERNEL_RANGE(5,14,0,70,0,0, 5,15,0,0,0,0) \ | ||
62 | || LTTNG_RHEL_KERNEL_RANGE(4,18,0,477,10,1, 4,19,0,0,0,0)) | ||
63 | -- | ||
64 | 2.39.2 | ||
65 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0002-Fix-ext4_da_reserve_space-changed-in-6.11-rc1.patch b/meta/recipes-kernel/lttng/lttng-modules/0002-Fix-ext4_da_reserve_space-changed-in-6.11-rc1.patch new file mode 100644 index 0000000000..94582cd47b --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0002-Fix-ext4_da_reserve_space-changed-in-6.11-rc1.patch | |||
@@ -0,0 +1,58 @@ | |||
1 | From 7f0f61083a9e88abb289c7575586178739e94955 Mon Sep 17 00:00:00 2001 | ||
2 | From: Kienan Stewart <kstewart@efficios.com> | ||
3 | Date: Mon, 29 Jul 2024 14:08:32 +0000 | ||
4 | Subject: [PATCH 2/6] Fix: ext4_da_reserve_space changed in 6.11-rc1 | ||
5 | |||
6 | See upstream commit: | ||
7 | |||
8 | commit 0d66b23d79c750276f791411d81a524549a64852 | ||
9 | Author: Zhang Yi <yi.zhang@huawei.com> | ||
10 | Date: Fri May 17 20:40:02 2024 +0800 | ||
11 | |||
12 | ext4: make ext4_da_reserve_space() reserve multi-clusters | ||
13 | |||
14 | Add 'nr_resv' parameter to ext4_da_reserve_space(), which indicates the | ||
15 | number of clusters wants to reserve, make it reserve multiple clusters | ||
16 | at a time. | ||
17 | |||
18 | Upstream-Status: Backport | ||
19 | |||
20 | Change-Id: Ib1ce8c3023d53a6d22ec444a435fdb3c871f64c5 | ||
21 | Signed-off-by: Kienan Stewart <kstewart@efficios.com> | ||
22 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
23 | --- | ||
24 | include/instrumentation/events/ext4.h | 18 +++++++++++++++++- | ||
25 | 1 file changed, 17 insertions(+), 1 deletion(-) | ||
26 | |||
27 | diff --git a/include/instrumentation/events/ext4.h b/include/instrumentation/events/ext4.h | ||
28 | index 462b11bf..addf2246 100644 | ||
29 | --- a/include/instrumentation/events/ext4.h | ||
30 | +++ b/include/instrumentation/events/ext4.h | ||
31 | @@ -730,7 +730,23 @@ LTTNG_TRACEPOINT_EVENT(ext4_da_update_reserve_space, | ||
32 | ) | ||
33 | #endif | ||
34 | |||
35 | -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,13,0)) | ||
36 | +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,11,0)) | ||
37 | +LTTNG_TRACEPOINT_EVENT(ext4_da_reserve_space, | ||
38 | + TP_PROTO(struct inode *inode, int nr_resv), | ||
39 | + | ||
40 | + TP_ARGS(inode, nr_resv), | ||
41 | + | ||
42 | + TP_FIELDS( | ||
43 | + ctf_integer(dev_t, dev, inode->i_sb->s_dev) | ||
44 | + ctf_integer(ino_t, ino, inode->i_ino) | ||
45 | + ctf_integer(__u64, i_blocks, inode->i_blocks) | ||
46 | + ctf_integer(__u64, nr_resv, nr_resv) | ||
47 | + ctf_integer(int, reserved_data_blocks, | ||
48 | + EXT4_I(inode)->i_reserved_data_blocks) | ||
49 | + ctf_integer(TP_MODE_T, mode, inode->i_mode) | ||
50 | + ) | ||
51 | +) | ||
52 | +#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,13,0)) | ||
53 | LTTNG_TRACEPOINT_EVENT(ext4_da_reserve_space, | ||
54 | TP_PROTO(struct inode *inode), | ||
55 | |||
56 | -- | ||
57 | 2.39.2 | ||
58 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0003-Fix-orig_start-removed-from-btrfs_get_extent-in-6.11.patch b/meta/recipes-kernel/lttng/lttng-modules/0003-Fix-orig_start-removed-from-btrfs_get_extent-in-6.11.patch new file mode 100644 index 0000000000..5273efe53e --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0003-Fix-orig_start-removed-from-btrfs_get_extent-in-6.11.patch | |||
@@ -0,0 +1,67 @@ | |||
1 | From aef97cb8d8ce45a9ea02eaedd20c28e4b69f4acf Mon Sep 17 00:00:00 2001 | ||
2 | From: Kienan Stewart <kstewart@efficios.com> | ||
3 | Date: Mon, 29 Jul 2024 14:11:36 +0000 | ||
4 | Subject: [PATCH 3/6] Fix: orig_start removed from btrfs_get_extent in 6.11-rc1 | ||
5 | |||
6 | See upstream commit: | ||
7 | |||
8 | commit 4aa7b5d1784f510c0f42afc1d74efb41947221d7 | ||
9 | Author: Qu Wenruo <wqu@suse.com> | ||
10 | Date: Tue Apr 30 07:53:04 2024 +0930 | ||
11 | |||
12 | btrfs: remove extent_map::orig_start member | ||
13 | |||
14 | Since we have extent_map::offset, the old extent_map::orig_start is just | ||
15 | extent_map::start - extent_map::offset for non-hole/inline extents. | ||
16 | |||
17 | And since the new extent_map::offset is already verified by | ||
18 | validate_extent_map() while the old orig_start is not, let's just remove | ||
19 | the old member from all call sites. | ||
20 | |||
21 | Upstream-Status: Backport | ||
22 | |||
23 | Change-Id: I025a30d49b3e3ddc37d7846acc191ebbdf2ff19e | ||
24 | Signed-off-by: Kienan Stewart <kstewart@efficios.com> | ||
25 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
26 | --- | ||
27 | include/instrumentation/events/btrfs.h | 24 +++++++++++++++++++++++- | ||
28 | 1 file changed, 23 insertions(+), 1 deletion(-) | ||
29 | |||
30 | diff --git a/include/instrumentation/events/btrfs.h b/include/instrumentation/events/btrfs.h | ||
31 | index f1b82db4..40139dee 100644 | ||
32 | --- a/include/instrumentation/events/btrfs.h | ||
33 | +++ b/include/instrumentation/events/btrfs.h | ||
34 | @@ -176,7 +176,29 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_evict, | ||
35 | ) | ||
36 | #endif | ||
37 | |||
38 | -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,8,0)) | ||
39 | +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,11,0)) | ||
40 | + | ||
41 | +LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, | ||
42 | + | ||
43 | + TP_PROTO(const struct btrfs_root *root, const struct btrfs_inode *inode, | ||
44 | + const struct extent_map *map), | ||
45 | + | ||
46 | + TP_ARGS(root, inode, map), | ||
47 | + | ||
48 | + TP_FIELDS( | ||
49 | + ctf_integer(u64, root_objectid, root->root_key.objectid) | ||
50 | + ctf_integer(u64, ino, btrfs_ino(inode)) | ||
51 | + ctf_integer(u64, start, map->start) | ||
52 | + ctf_integer(u64, len, map->len) | ||
53 | + ctf_integer(u64, block_start, map->block_start) | ||
54 | + ctf_integer(u64, block_len, map->block_len) | ||
55 | + ctf_integer(unsigned int, flags, map->flags) | ||
56 | + ctf_integer(int, refs, refcount_read(&map->refs)) | ||
57 | + ctf_integer(unsigned int, compress_type, extent_map_compression(map)) | ||
58 | + ) | ||
59 | +) | ||
60 | + | ||
61 | +#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,8,0)) | ||
62 | |||
63 | LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, | ||
64 | |||
65 | -- | ||
66 | 2.39.2 | ||
67 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0004-Fix-block_len-removed-frmo-btrfs_get_extent-in-6.11-.patch b/meta/recipes-kernel/lttng/lttng-modules/0004-Fix-block_len-removed-frmo-btrfs_get_extent-in-6.11-.patch new file mode 100644 index 0000000000..8dab9cac47 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0004-Fix-block_len-removed-frmo-btrfs_get_extent-in-6.11-.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From d44bc12d138513eb3d1dae4e66a4d76d7c567212 Mon Sep 17 00:00:00 2001 | ||
2 | From: Kienan Stewart <kstewart@efficios.com> | ||
3 | Date: Mon, 29 Jul 2024 14:12:47 +0000 | ||
4 | Subject: [PATCH 4/6] Fix: block_len removed frmo btrfs_get_extent in 6.11-rc1 | ||
5 | |||
6 | See upstream commit: | ||
7 | |||
8 | commit e28b851ed9b232c3b84cb8d0fedbdfa8ca881386 | ||
9 | Author: Qu Wenruo <wqu@suse.com> | ||
10 | Date: Tue Apr 30 07:53:05 2024 +0930 | ||
11 | |||
12 | btrfs: remove extent_map::block_len member | ||
13 | |||
14 | The extent_map::block_len is either extent_map::len (non-compressed | ||
15 | extent) or extent_map::disk_num_bytes (compressed extent). | ||
16 | |||
17 | Since we already have sanity checks to do the cross-checks between the | ||
18 | new and old members, we can drop the old extent_map::block_len now. | ||
19 | |||
20 | For most call sites, they can manually select extent_map::len or | ||
21 | extent_map::disk_num_bytes, since most if not all of them have checked | ||
22 | if the extent is compressed. | ||
23 | |||
24 | Upstream-Status: Backport | ||
25 | |||
26 | Change-Id: Ib03fc685b4e876bf4e53afdd28ca9826342a0e4e | ||
27 | Signed-off-by: Kienan Stewart <kstewart@efficios.com> | ||
28 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
29 | --- | ||
30 | include/instrumentation/events/btrfs.h | 1 - | ||
31 | 1 file changed, 1 deletion(-) | ||
32 | |||
33 | diff --git a/include/instrumentation/events/btrfs.h b/include/instrumentation/events/btrfs.h | ||
34 | index 40139dee..a764fb3b 100644 | ||
35 | --- a/include/instrumentation/events/btrfs.h | ||
36 | +++ b/include/instrumentation/events/btrfs.h | ||
37 | @@ -191,7 +191,6 @@ LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, | ||
38 | ctf_integer(u64, start, map->start) | ||
39 | ctf_integer(u64, len, map->len) | ||
40 | ctf_integer(u64, block_start, map->block_start) | ||
41 | - ctf_integer(u64, block_len, map->block_len) | ||
42 | ctf_integer(unsigned int, flags, map->flags) | ||
43 | ctf_integer(int, refs, refcount_read(&map->refs)) | ||
44 | ctf_integer(unsigned int, compress_type, extent_map_compression(map)) | ||
45 | -- | ||
46 | 2.39.2 | ||
47 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0005-Fix-block_start-removed-from-btrfs_get_extent-in-6.1.patch b/meta/recipes-kernel/lttng/lttng-modules/0005-Fix-block_start-removed-from-btrfs_get_extent-in-6.1.patch new file mode 100644 index 0000000000..da933d2f72 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0005-Fix-block_start-removed-from-btrfs_get_extent-in-6.1.patch | |||
@@ -0,0 +1,54 @@ | |||
1 | From f2762247871d9340f3cbe7e40f25ceb6dbdb81f1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Kienan Stewart <kstewart@efficios.com> | ||
3 | Date: Mon, 29 Jul 2024 14:14:24 +0000 | ||
4 | Subject: [PATCH 5/6] Fix: block_start removed from btrfs_get_extent in | ||
5 | 6.11-rc1 | ||
6 | |||
7 | See upstream commit: | ||
8 | |||
9 | commit c77a8c61002e91d859e118008fd495efbe1d9373 | ||
10 | Author: Qu Wenruo <wqu@suse.com> | ||
11 | Date: Tue Apr 30 07:53:06 2024 +0930 | ||
12 | |||
13 | btrfs: remove extent_map::block_start member | ||
14 | |||
15 | The member extent_map::block_start can be calculated from | ||
16 | extent_map::disk_bytenr + extent_map::offset for regular extents. | ||
17 | And otherwise just extent_map::disk_bytenr. | ||
18 | |||
19 | And this is already validated by the validate_extent_map(). Now we can | ||
20 | remove the member. | ||
21 | |||
22 | However there is a special case in btrfs_create_dio_extent() where we | ||
23 | for NOCOW/PREALLOC ordered extents cannot directly use the resulting | ||
24 | btrfs_file_extent, as btrfs_split_ordered_extent() cannot handle them | ||
25 | yet. | ||
26 | |||
27 | So for that call site, we pass file_extent->disk_bytenr + | ||
28 | file_extent->num_bytes as disk_bytenr for the ordered extent, and 0 for | ||
29 | offset. | ||
30 | |||
31 | Upstream-Status: Backport | ||
32 | |||
33 | Change-Id: I2e3245bb0d1f5263e902659aa05848d5e231909b | ||
34 | Signed-off-by: Kienan Stewart <kstewart@efficios.com> | ||
35 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
36 | --- | ||
37 | include/instrumentation/events/btrfs.h | 1 - | ||
38 | 1 file changed, 1 deletion(-) | ||
39 | |||
40 | diff --git a/include/instrumentation/events/btrfs.h b/include/instrumentation/events/btrfs.h | ||
41 | index a764fb3b..4ceb8e02 100644 | ||
42 | --- a/include/instrumentation/events/btrfs.h | ||
43 | +++ b/include/instrumentation/events/btrfs.h | ||
44 | @@ -190,7 +190,6 @@ LTTNG_TRACEPOINT_EVENT(btrfs_get_extent, | ||
45 | ctf_integer(u64, ino, btrfs_ino(inode)) | ||
46 | ctf_integer(u64, start, map->start) | ||
47 | ctf_integer(u64, len, map->len) | ||
48 | - ctf_integer(u64, block_start, map->block_start) | ||
49 | ctf_integer(unsigned int, flags, map->flags) | ||
50 | ctf_integer(int, refs, refcount_read(&map->refs)) | ||
51 | ctf_integer(unsigned int, compress_type, extent_map_compression(map)) | ||
52 | -- | ||
53 | 2.39.2 | ||
54 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0006-Fix-scsi-sd-Atomic-write-support-added-in-6.11-rc1.patch b/meta/recipes-kernel/lttng/lttng-modules/0006-Fix-scsi-sd-Atomic-write-support-added-in-6.11-rc1.patch new file mode 100644 index 0000000000..778c7e3b86 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0006-Fix-scsi-sd-Atomic-write-support-added-in-6.11-rc1.patch | |||
@@ -0,0 +1,203 @@ | |||
1 | From 166a05ce64a05218f51563d201644ab3bfddaacc Mon Sep 17 00:00:00 2001 | ||
2 | From: Kienan Stewart <kstewart@efficios.com> | ||
3 | Date: Mon, 29 Jul 2024 14:23:02 +0000 | ||
4 | Subject: [PATCH 6/6] Fix: scsi: sd: Atomic write support added in 6.11-rc1 | ||
5 | |||
6 | See upstream commit: | ||
7 | |||
8 | commit bf4ae8f2e6407a779c0368eb0f3e047a8333be17 | ||
9 | Author: John Garry <john.g.garry@oracle.com> | ||
10 | Date: Thu Jun 20 12:53:57 2024 +0000 | ||
11 | |||
12 | scsi: sd: Atomic write support | ||
13 | |||
14 | Support is divided into two main areas: | ||
15 | - reading VPD pages and setting sdev request_queue limits | ||
16 | - support WRITE ATOMIC (16) command and tracing | ||
17 | |||
18 | The relevant block limits VPD page need to be read to allow the block layer | ||
19 | request_queue atomic write limits to be set. These VPD page limits are | ||
20 | described in sbc4r22 section 6.6.4 - Block limits VPD page. | ||
21 | |||
22 | There are five limits of interest: | ||
23 | - MAXIMUM ATOMIC TRANSFER LENGTH | ||
24 | - ATOMIC ALIGNMENT | ||
25 | - ATOMIC TRANSFER LENGTH GRANULARITY | ||
26 | - MAXIMUM ATOMIC TRANSFER LENGTH WITH BOUNDARY | ||
27 | - MAXIMUM ATOMIC BOUNDARY SIZE | ||
28 | |||
29 | MAXIMUM ATOMIC TRANSFER LENGTH is the maximum length for a WRITE ATOMIC | ||
30 | (16) command. It will not be greater than the device MAXIMUM TRANSFER | ||
31 | LENGTH. | ||
32 | |||
33 | ATOMIC ALIGNMENT and ATOMIC TRANSFER LENGTH GRANULARITY are the minimum | ||
34 | alignment and length values for an atomic write in terms of logical blocks. | ||
35 | |||
36 | Unlike NVMe, SCSI does not specify an LBA space boundary, but does specify | ||
37 | a per-IO boundary granularity. The maximum boundary size is specified in | ||
38 | MAXIMUM ATOMIC BOUNDARY SIZE. When used, this boundary value is set in the | ||
39 | WRITE ATOMIC (16) ATOMIC BOUNDARY field - layout for the WRITE_ATOMIC_16 | ||
40 | command can be found in sbc4r22 section 5.48. This boundary value is the | ||
41 | granularity size at which the device may atomically write the data. A value | ||
42 | of zero in WRITE ATOMIC (16) ATOMIC BOUNDARY field means that all data must | ||
43 | be atomically written together. | ||
44 | |||
45 | MAXIMUM ATOMIC TRANSFER LENGTH WITH BOUNDARY is the maximum atomic write | ||
46 | length if a non-zero boundary value is set. | ||
47 | |||
48 | For atomic write support, the WRITE ATOMIC (16) boundary is not of much | ||
49 | interest, as the block layer expects each request submitted to be executed | ||
50 | be atomically written together. | ||
51 | |||
52 | MAXIMUM ATOMIC TRANSFER LENGTH WITH BOUNDARY is the maximum atomic write | ||
53 | length if a non-zero boundary value is set. | ||
54 | |||
55 | For atomic write support, the WRITE ATOMIC (16) boundary is not of much | ||
56 | interest, as the block layer expects each request submitted to be executed | ||
57 | atomically. However, the SCSI spec does leave itself open to a quirky | ||
58 | scenario where MAXIMUM ATOMIC TRANSFER LENGTH is zero, yet MAXIMUM ATOMIC | ||
59 | TRANSFER LENGTH WITH BOUNDARY and MAXIMUM ATOMIC BOUNDARY SIZE are both | ||
60 | non-zero. This case will be supported. | ||
61 | |||
62 | To set the block layer request_queue atomic write capabilities, sanitize | ||
63 | the VPD page limits and set limits as follows: | ||
64 | - atomic_write_unit_min is derived from granularity and alignment values. | ||
65 | If no granularity value is not set, use physical block size | ||
66 | - atomic_write_unit_max is derived from MAXIMUM ATOMIC TRANSFER LENGTH. In | ||
67 | the scenario where MAXIMUM ATOMIC TRANSFER LENGTH is zero and boundary | ||
68 | limits are non-zero, use MAXIMUM ATOMIC BOUNDARY SIZE for | ||
69 | atomic_write_unit_max. New flag scsi_disk.use_atomic_write_boundary is | ||
70 | set for this scenario. | ||
71 | - atomic_write_boundary_bytes is set to zero always | ||
72 | |||
73 | SCSI also supports a WRITE ATOMIC (32) command, which is for type 2 | ||
74 | protection enabled. This is not going to be supported now, so check for | ||
75 | T10_PI_TYPE2_PROTECTION when setting any request_queue limits. | ||
76 | |||
77 | To handle an atomic write request, add support for WRITE ATOMIC (16) | ||
78 | command in handler sd_setup_atomic_cmnd(). Flag use_atomic_write_boundary | ||
79 | is checked here for encoding ATOMIC BOUNDARY field. | ||
80 | |||
81 | Trace info is also added for WRITE_ATOMIC_16 command. | ||
82 | |||
83 | Upstream-Status: Backport | ||
84 | |||
85 | Change-Id: Ie072002fe2184615c72531ac081a324ef18cfb03 | ||
86 | Signed-off-by: Kienan Stewart <kstewart@efficios.com> | ||
87 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
88 | --- | ||
89 | include/instrumentation/events/scsi.h | 98 ++++++++++++++++++++++++++- | ||
90 | 1 file changed, 97 insertions(+), 1 deletion(-) | ||
91 | |||
92 | diff --git a/include/instrumentation/events/scsi.h b/include/instrumentation/events/scsi.h | ||
93 | index de2a1998..175ab003 100644 | ||
94 | --- a/include/instrumentation/events/scsi.h | ||
95 | +++ b/include/instrumentation/events/scsi.h | ||
96 | @@ -19,7 +19,103 @@ | ||
97 | |||
98 | #define scsi_opcode_name(opcode) { opcode, #opcode } | ||
99 | |||
100 | -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,7,0) \ | ||
101 | +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,11,0)) | ||
102 | + | ||
103 | +#define show_opcode_name(val) \ | ||
104 | + __print_symbolic(val, \ | ||
105 | + scsi_opcode_name(TEST_UNIT_READY), \ | ||
106 | + scsi_opcode_name(REZERO_UNIT), \ | ||
107 | + scsi_opcode_name(REQUEST_SENSE), \ | ||
108 | + scsi_opcode_name(FORMAT_UNIT), \ | ||
109 | + scsi_opcode_name(READ_BLOCK_LIMITS), \ | ||
110 | + scsi_opcode_name(REASSIGN_BLOCKS), \ | ||
111 | + scsi_opcode_name(INITIALIZE_ELEMENT_STATUS), \ | ||
112 | + scsi_opcode_name(READ_6), \ | ||
113 | + scsi_opcode_name(WRITE_6), \ | ||
114 | + scsi_opcode_name(SEEK_6), \ | ||
115 | + scsi_opcode_name(READ_REVERSE), \ | ||
116 | + scsi_opcode_name(WRITE_FILEMARKS), \ | ||
117 | + scsi_opcode_name(SPACE), \ | ||
118 | + scsi_opcode_name(INQUIRY), \ | ||
119 | + scsi_opcode_name(RECOVER_BUFFERED_DATA), \ | ||
120 | + scsi_opcode_name(MODE_SELECT), \ | ||
121 | + scsi_opcode_name(RESERVE), \ | ||
122 | + scsi_opcode_name(RELEASE), \ | ||
123 | + scsi_opcode_name(COPY), \ | ||
124 | + scsi_opcode_name(ERASE), \ | ||
125 | + scsi_opcode_name(MODE_SENSE), \ | ||
126 | + scsi_opcode_name(START_STOP), \ | ||
127 | + scsi_opcode_name(RECEIVE_DIAGNOSTIC), \ | ||
128 | + scsi_opcode_name(SEND_DIAGNOSTIC), \ | ||
129 | + scsi_opcode_name(ALLOW_MEDIUM_REMOVAL), \ | ||
130 | + scsi_opcode_name(SET_WINDOW), \ | ||
131 | + scsi_opcode_name(READ_CAPACITY), \ | ||
132 | + scsi_opcode_name(READ_10), \ | ||
133 | + scsi_opcode_name(WRITE_10), \ | ||
134 | + scsi_opcode_name(SEEK_10), \ | ||
135 | + scsi_opcode_name(POSITION_TO_ELEMENT), \ | ||
136 | + scsi_opcode_name(WRITE_VERIFY), \ | ||
137 | + scsi_opcode_name(VERIFY), \ | ||
138 | + scsi_opcode_name(SEARCH_HIGH), \ | ||
139 | + scsi_opcode_name(SEARCH_EQUAL), \ | ||
140 | + scsi_opcode_name(SEARCH_LOW), \ | ||
141 | + scsi_opcode_name(SET_LIMITS), \ | ||
142 | + scsi_opcode_name(PRE_FETCH), \ | ||
143 | + scsi_opcode_name(READ_POSITION), \ | ||
144 | + scsi_opcode_name(SYNCHRONIZE_CACHE), \ | ||
145 | + scsi_opcode_name(LOCK_UNLOCK_CACHE), \ | ||
146 | + scsi_opcode_name(READ_DEFECT_DATA), \ | ||
147 | + scsi_opcode_name(MEDIUM_SCAN), \ | ||
148 | + scsi_opcode_name(COMPARE), \ | ||
149 | + scsi_opcode_name(COPY_VERIFY), \ | ||
150 | + scsi_opcode_name(WRITE_BUFFER), \ | ||
151 | + scsi_opcode_name(READ_BUFFER), \ | ||
152 | + scsi_opcode_name(UPDATE_BLOCK), \ | ||
153 | + scsi_opcode_name(READ_LONG), \ | ||
154 | + scsi_opcode_name(WRITE_LONG), \ | ||
155 | + scsi_opcode_name(CHANGE_DEFINITION), \ | ||
156 | + scsi_opcode_name(WRITE_SAME), \ | ||
157 | + scsi_opcode_name(UNMAP), \ | ||
158 | + scsi_opcode_name(READ_TOC), \ | ||
159 | + scsi_opcode_name(LOG_SELECT), \ | ||
160 | + scsi_opcode_name(LOG_SENSE), \ | ||
161 | + scsi_opcode_name(XDWRITEREAD_10), \ | ||
162 | + scsi_opcode_name(MODE_SELECT_10), \ | ||
163 | + scsi_opcode_name(RESERVE_10), \ | ||
164 | + scsi_opcode_name(RELEASE_10), \ | ||
165 | + scsi_opcode_name(MODE_SENSE_10), \ | ||
166 | + scsi_opcode_name(PERSISTENT_RESERVE_IN), \ | ||
167 | + scsi_opcode_name(PERSISTENT_RESERVE_OUT), \ | ||
168 | + scsi_opcode_name(VARIABLE_LENGTH_CMD), \ | ||
169 | + scsi_opcode_name(REPORT_LUNS), \ | ||
170 | + scsi_opcode_name(MAINTENANCE_IN), \ | ||
171 | + scsi_opcode_name(MAINTENANCE_OUT), \ | ||
172 | + scsi_opcode_name(MOVE_MEDIUM), \ | ||
173 | + scsi_opcode_name(EXCHANGE_MEDIUM), \ | ||
174 | + scsi_opcode_name(READ_12), \ | ||
175 | + scsi_opcode_name(WRITE_12), \ | ||
176 | + scsi_opcode_name(WRITE_VERIFY_12), \ | ||
177 | + scsi_opcode_name(SEARCH_HIGH_12), \ | ||
178 | + scsi_opcode_name(SEARCH_EQUAL_12), \ | ||
179 | + scsi_opcode_name(SEARCH_LOW_12), \ | ||
180 | + scsi_opcode_name(READ_ELEMENT_STATUS), \ | ||
181 | + scsi_opcode_name(SEND_VOLUME_TAG), \ | ||
182 | + scsi_opcode_name(WRITE_LONG_2), \ | ||
183 | + scsi_opcode_name(READ_16), \ | ||
184 | + scsi_opcode_name(WRITE_16), \ | ||
185 | + scsi_opcode_name(VERIFY_16), \ | ||
186 | + scsi_opcode_name(WRITE_SAME_16), \ | ||
187 | + scsi_opcode_name(ZBC_OUT), \ | ||
188 | + scsi_opcode_name(ZBC_IN), \ | ||
189 | + scsi_opcode_name(SERVICE_ACTION_IN_16), \ | ||
190 | + scsi_opcode_name(READ_32), \ | ||
191 | + scsi_opcode_name(WRITE_32), \ | ||
192 | + scsi_opcode_name(WRITE_SAME_32), \ | ||
193 | + scsi_opcode_name(ATA_16), \ | ||
194 | + scsi_opcode_name(WRITE_ATOMIC_16), \ | ||
195 | + scsi_opcode_name(ATA_12)) | ||
196 | + | ||
197 | +#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,7,0) \ | ||
198 | || LTTNG_SLE_KERNEL_RANGE(4,4,9,36,0,0, 4,5,0,0,0,0)) | ||
199 | |||
200 | #define show_opcode_name(val) \ | ||
201 | -- | ||
202 | 2.39.2 | ||
203 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-modules_2.13.13.bb b/meta/recipes-kernel/lttng/lttng-modules_2.13.13.bb index 75b144757a..0363e8be70 100644 --- a/meta/recipes-kernel/lttng/lttng-modules_2.13.13.bb +++ b/meta/recipes-kernel/lttng/lttng-modules_2.13.13.bb | |||
@@ -14,6 +14,12 @@ SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2 \ | |||
14 | file://0002-fix-btrfs-move-parent-and-ref_root-into-btrfs_delaye.patch \ | 14 | file://0002-fix-btrfs-move-parent-and-ref_root-into-btrfs_delaye.patch \ |
15 | file://0003-fix-net-udp-add-IP-port-data-to-the-tracepoint-udp-u.patch \ | 15 | file://0003-fix-net-udp-add-IP-port-data-to-the-tracepoint-udp-u.patch \ |
16 | file://0001-fix-close_on_exec-pass-files_struct-instead-of-fdtab.patch \ | 16 | file://0001-fix-close_on_exec-pass-files_struct-instead-of-fdtab.patch \ |
17 | file://0001-Fix-kfree_skb-changed-in-6.11-rc1.patch \ | ||
18 | file://0002-Fix-ext4_da_reserve_space-changed-in-6.11-rc1.patch \ | ||
19 | file://0003-Fix-orig_start-removed-from-btrfs_get_extent-in-6.11.patch \ | ||
20 | file://0004-Fix-block_len-removed-frmo-btrfs_get_extent-in-6.11-.patch \ | ||
21 | file://0005-Fix-block_start-removed-from-btrfs_get_extent-in-6.1.patch \ | ||
22 | file://0006-Fix-scsi-sd-Atomic-write-support-added-in-6.11-rc1.patch \ | ||
17 | " | 23 | " |
18 | 24 | ||
19 | # Use :append here so that the patch is applied also when using devupstream | 25 | # Use :append here so that the patch is applied also when using devupstream |