diff options
-rw-r--r-- | .SRCINFO | 34 | ||||
-rw-r--r-- | 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch | 6 | ||||
-rw-r--r-- | 0002-Bluetooth-Fix-attempting-to-set-RPA-timeout-when-uns.patch | 49 | ||||
-rw-r--r-- | 0002-HID-quirks-Add-Apple-Magic-Trackpad-2-to-hid_have_sp.patch (renamed from 0003-HID-quirks-Add-Apple-Magic-Trackpad-2-to-hid_have_sp.patch) | 4 | ||||
-rw-r--r-- | 0003-iwlwifi-Fix-regression-from-UDP-segmentation-support.patch (renamed from 0006-iwlwifi-Fix-regression-from-UDP-segmentation-support.patch) | 4 | ||||
-rw-r--r-- | 0004-btrfs-fix-deadlock-when-cloning-inline-extent-and-lo.patch | 325 | ||||
-rw-r--r-- | 0005-btrfs-Fix-500-2000-performance-regression-w-5.10.patch | 61 | ||||
-rw-r--r-- | 0005-btrfs-shrink-delalloc-pages-instead-of-full-inodes.patch | 184 | ||||
-rw-r--r-- | 0007-ALSA-hda-hdmi-fix-locking-in-silent_stream_disable.patch | 26 | ||||
-rw-r--r-- | PKGBUILD | 68 |
10 files changed, 580 insertions, 181 deletions
@@ -1,5 +1,5 @@ pkgbase = linux-rc - pkgver = 5.10.5rc1 + pkgver = 5.10.7rc1 pkgrel = 1 url = https://www.kernel.org/ arch = x86_64 @@ -12,30 +12,28 @@ pkgbase = linux-rc makedepends = tar makedepends = xz options = !strip - source = https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.5-rc1.xz - source = https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.5-rc1.sign - source = https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.10.4.tar.xz - source = https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.10.4.tar.sign + source = https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.7-rc1.xz + source = https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.7-rc1.sign + source = https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.10.6.tar.xz + source = https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.10.6.tar.sign source = config source = 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch - source = 0002-Bluetooth-Fix-attempting-to-set-RPA-timeout-when-uns.patch - source = 0003-HID-quirks-Add-Apple-Magic-Trackpad-2-to-hid_have_sp.patch - source = 0005-btrfs-Fix-500-2000-performance-regression-w-5.10.patch - source = 0006-iwlwifi-Fix-regression-from-UDP-segmentation-support.patch - source = 0007-ALSA-hda-hdmi-fix-locking-in-silent_stream_disable.patch + source = 0002-HID-quirks-Add-Apple-Magic-Trackpad-2-to-hid_have_sp.patch + source = 0003-iwlwifi-Fix-regression-from-UDP-segmentation-support.patch + source = 0004-btrfs-fix-deadlock-when-cloning-inline-extent-and-lo.patch + source = 0005-btrfs-shrink-delalloc-pages-instead-of-full-inodes.patch validpgpkeys = ABAF11C65A2970B130ABE3C479BE3E4300411886 validpgpkeys = 647F28654894E3BD457199BE38DBBDC86092693E - b2sums = 3a4fa6e77721b0dc3b74e0e1c6d6af2aaf33286d5fc3bf6e0ae844cbed2f745cfa3fa8a83b406082e1e981125cf1c09a5df765e990a132713e7a05281a936394 + b2sums = d751bad7450ea12ea43b4565093d1da2ac0c4e1ecd4d50de3096a7d0a9717e8781b93cfbb156edc859f2c38805ab2d0fc71d7d6c128fdbe415cd5e5aff3f2dde b2sums = SKIP - b2sums = 57f6d719451aacfd298452703ae02e6188885500e8cdf18fffa6b9967b0934a23cd378ab4c49b76ccb2f7a9012d6aa7ff1349d488cb31e40924be2f27b244cec + b2sums = 2da9e47f6524ecb50db9f515b9f281f08fbcb323f6e4ddb225c2b2f6379787c37efee25589e49286e13ff663c414a422b680912739400afab89f0ebaf741d33b b2sums = SKIP b2sums = cb3a58e4eef8395b75887d94a84bba25f05fbec8f576a791623057a190a1d51b412a19ecf1b600ac3f9f6c46968eb0e130d571743e61afc231a97146ee4b52d0 - b2sums = 7d2ef86a15ead6c946051c117a8ed97056e92a25a274455c5cc62ec65ff92bda7a50032b32c8019180f233a54e778becc45751741ae4d87db8f56ef520ca1e83 - b2sums = 8ea9d2b7809728c3de05768fea5d8838fe20de8aaaed9106f26c0e8fc051921668d0c31345f200d06005403dec565690f828dbbcd38504079fe6fccbf742be61 - b2sums = d361b313a3dcd761833b8e2e40201df5e5b93c472e8a06f4684feb24d6e174405e6e4328dc0c449b9b0263e87224b3e1f4a52c873b666a93055979c9d2e2bf59 - b2sums = 2853fa5257b96b11bcbf60ed68df09938ebb15f81c1bb6aa763c721c4e55f440fd27f9a6b49e8f9a1788948928299810f9e8ea43f0759b06cae3dd140902f93e - b2sums = 46a30c86206717fe6804d8e88693b90382b07fdad91d8fd7220e398e41f87a4b5cb5be70285241a3fc81c62ced6021f1710ce0426f3161285c254db9e5484d86 - b2sums = eec26b472efda62e27d26c2033158e970a5eadb30d38fc4de59c36fafe53efc1e220b7d57189abcd5a2697d242df8475cf2eebfd1ad6373804b5456dbcc14098 + b2sums = b42730a806a63dbf905f448a3282dec72a950ef7d16a3531d977dcae3b5c2685a5c5dd10a58e345d57084a6212353dc2f2f0102021d13c1557092e564f81eaf5 + b2sums = a5dea5bb6df6fb517009ad5b104c2ea8e93ed880393a1412ca2d7fc8047abccc9c72076e40d1d4133cadc9048040846cc9bdc91e30c4d601ad5963d13498503e + b2sums = 9a8723104239ba4646dd0c76c5a60128892954dd2faee69ca5c5d1251c9694de8fd528ca063a2add1401ad1375ad0dcc2560ca03a1bfd03b161d34ccd25b686a + b2sums = e0da90b08fb03658dca9c42ac287c04d9b35969a15165c0f1fc7e11290de272b892abb58f5c7aabe22899f53f5bc39539f58768b8012d92145ba2fd8b89898a7 + b2sums = 2b180269f934469d6ef6f0f8474dd947c7a8e9344cf3bbecac6a9c325d7bfb89d234eb15c4422709acaffd30ebeda2ec06c91a8c1128631a839186e8b273eb65 pkgname = linux-rc pkgdesc = The release candidate kernel and modules diff --git a/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch b/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch index 5c8add1c1e4..1bd450d72b9 100644 --- a/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch +++ b/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch @@ -1,7 +1,7 @@ -From 3a8bc83f97cb4ef7ad72a742382f373357d4d95b Mon Sep 17 00:00:00 2001 +From 2c517031bd7c5d34a05980c656ce2b6c6fbf1f78 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com> Date: Mon, 16 Sep 2019 04:53:20 +0200 -Subject: [PATCH 1/8] ZEN: Add sysctl and CONFIG to disallow unprivileged +Subject: [PATCH 1/6] ZEN: Add sysctl and CONFIG to disallow unprivileged CLONE_NEWUSER Our default behavior continues to match the vanilla kernel. @@ -63,7 +63,7 @@ index 0872a5a2e759..a40d8afeb1bb 100644 bool "PID Namespaces" default y diff --git a/kernel/fork.c b/kernel/fork.c -index dc55f68a6ee3..15d29085d1ff 100644 +index c675fdbd3dce..9266039e28e4 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -97,6 +97,10 @@ diff --git a/0002-Bluetooth-Fix-attempting-to-set-RPA-timeout-when-uns.patch b/0002-Bluetooth-Fix-attempting-to-set-RPA-timeout-when-uns.patch deleted file mode 100644 index 5d60cc098ff..00000000000 --- a/0002-Bluetooth-Fix-attempting-to-set-RPA-timeout-when-uns.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 0438f3011663ce01a981bb8b3af0e84e73551ecf Mon Sep 17 00:00:00 2001 -From: Edward Vear <edwardvear@gmail.com> -Date: Tue, 27 Oct 2020 00:02:03 -0700 -Subject: [PATCH 2/8] Bluetooth: Fix attempting to set RPA timeout when - unsupported - -During controller initialization, an LE Set RPA Timeout command is sent -to the controller if supported. However, the value checked to determine -if the command is supported is incorrect. Page 1921 of the Bluetooth -Core Spec v5.2 shows that bit 2 of octet 35 of the Supported_Commands -field corresponds to the LE Set RPA Timeout command, but currently -bit 6 of octet 35 is checked. This patch checks the correct value -instead. - -This issue led to the error seen in the following btmon output during -initialization of an adapter (rtl8761b) and prevented initialization -from completing. - -< HCI Command: LE Set Resolvable Private Address Timeout (0x08|0x002e) plen 2 - Timeout: 900 seconds -> HCI Event: Command Complete (0x0e) plen 4 - LE Set Resolvable Private Address Timeout (0x08|0x002e) ncmd 2 - Status: Unsupported Remote Feature / Unsupported LMP Feature (0x1a) -= Close Index: 00:E0:4C:6B:E5:03 - -The error did not appear when running with this patch. - -Signed-off-by: Edward Vear <edwardvear@gmail.com> -Signed-off-by: Marcel Holtmann <marcel@holtmann.org> ---- - net/bluetooth/hci_core.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c -index 502552d6e9af..c4aa2cbb9269 100644 ---- a/net/bluetooth/hci_core.c -+++ b/net/bluetooth/hci_core.c -@@ -763,7 +763,7 @@ static int hci_init3_req(struct hci_request *req, unsigned long opt) - hci_req_add(req, HCI_OP_LE_CLEAR_RESOLV_LIST, 0, NULL); - } - -- if (hdev->commands[35] & 0x40) { -+ if (hdev->commands[35] & 0x04) { - __le16 rpa_timeout = cpu_to_le16(hdev->rpa_timeout); - - /* Set RPA timeout */ --- -2.30.0 - diff --git a/0003-HID-quirks-Add-Apple-Magic-Trackpad-2-to-hid_have_sp.patch b/0002-HID-quirks-Add-Apple-Magic-Trackpad-2-to-hid_have_sp.patch index f49bf27f2ad..2cd0cba1b2c 100644 --- a/0003-HID-quirks-Add-Apple-Magic-Trackpad-2-to-hid_have_sp.patch +++ b/0002-HID-quirks-Add-Apple-Magic-Trackpad-2-to-hid_have_sp.patch @@ -1,7 +1,7 @@ -From e5e77ad2223f662e1615266d8ef39a8db7e65a70 Mon Sep 17 00:00:00 2001 +From eeab2ccf0d788a6895b3b9a21c505d78ceec43e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20H=C3=A4dicke?= <felixhaedicke@web.de> Date: Thu, 19 Nov 2020 09:22:32 +0100 -Subject: [PATCH 3/8] HID: quirks: Add Apple Magic Trackpad 2 to +Subject: [PATCH 2/6] HID: quirks: Add Apple Magic Trackpad 2 to hid_have_special_driver list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 diff --git a/0006-iwlwifi-Fix-regression-from-UDP-segmentation-support.patch b/0003-iwlwifi-Fix-regression-from-UDP-segmentation-support.patch index 37532e1696d..b474b4a8dc5 100644 --- a/0006-iwlwifi-Fix-regression-from-UDP-segmentation-support.patch +++ b/0003-iwlwifi-Fix-regression-from-UDP-segmentation-support.patch @@ -1,7 +1,7 @@ -From 61e5f6548784e507eb0662a71976a673436e6e3a Mon Sep 17 00:00:00 2001 +From 631f3ba6f0debde7efcadc90fb9abef10a271148 Mon Sep 17 00:00:00 2001 From: Eric Dumazet <edumazet@google.com> Date: Mon, 21 Dec 2020 20:14:02 +0100 -Subject: [PATCH 6/8] iwlwifi: Fix regression from UDP segmentation support +Subject: [PATCH 3/6] iwlwifi: Fix regression from UDP segmentation support Eric's tentative fix from https://lore.kernel.org/linux-wireless/CANn89iJWG2n1s3j7EdpwkQQv-9dOY02V+FGYHAWguO4JiqWuJA@mail.gmail.com/ diff --git a/0004-btrfs-fix-deadlock-when-cloning-inline-extent-and-lo.patch b/0004-btrfs-fix-deadlock-when-cloning-inline-extent-and-lo.patch new file mode 100644 index 00000000000..97ea363cf29 --- /dev/null +++ b/0004-btrfs-fix-deadlock-when-cloning-inline-extent-and-lo.patch @@ -0,0 +1,325 @@ +From e763d7a19f256a8861ee2c1eedaaf42f603488d2 Mon Sep 17 00:00:00 2001 +From: Filipe Manana <fdmanana@suse.com> +Date: Wed, 2 Dec 2020 11:55:58 +0000 +Subject: [PATCH 4/6] btrfs: fix deadlock when cloning inline extent and low on + free metadata space + +When cloning an inline extent there are cases where we can not just copy +the inline extent from the source range to the target range (e.g. when the +target range starts at an offset greater than zero). In such cases we copy +the inline extent's data into a page of the destination inode and then +dirty that page. However, after that we will need to start a transaction +for each processed extent and, if we are ever low on available metadata +space, we may need to flush existing delalloc for all dirty inodes in an +attempt to release metadata space - if that happens we may deadlock: + +* the async reclaim task queued a delalloc work to flush delalloc for + the destination inode of the clone operation; + +* the task executing that delalloc work gets blocked waiting for the + range with the dirty page to be unlocked, which is currently locked + by the task doing the clone operation; + +* the async reclaim task blocks waiting for the delalloc work to complete; + +* the cloning task is waiting on the waitqueue of its reservation ticket + while holding the range with the dirty page locked in the inode's + io_tree; + +* if metadata space is not released by some other task (like delalloc for + some other inode completing for example), the clone task waits forever + and as a consequence the delalloc work and async reclaim tasks will hang + forever as well. Releasing more space on the other hand may require + starting a transaction, which will hang as well when trying to reserve + metadata space, resulting in a deadlock between all these tasks. + +When this happens, traces like the following show up in dmesg/syslog: + + [87452.323003] INFO: task kworker/u16:11:1810830 blocked for more than 120 seconds. + [87452.323644] Tainted: G B W 5.10.0-rc4-btrfs-next-73 #1 + [87452.324248] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. + [87452.324852] task:kworker/u16:11 state:D stack: 0 pid:1810830 ppid: 2 flags:0x00004000 + [87452.325520] Workqueue: btrfs-flush_delalloc btrfs_work_helper [btrfs] + [87452.326136] Call Trace: + [87452.326737] __schedule+0x5d1/0xcf0 + [87452.327390] schedule+0x45/0xe0 + [87452.328174] lock_extent_bits+0x1e6/0x2d0 [btrfs] + [87452.328894] ? finish_wait+0x90/0x90 + [87452.329474] btrfs_invalidatepage+0x32c/0x390 [btrfs] + [87452.330133] ? __mod_memcg_state+0x8e/0x160 + [87452.330738] __extent_writepage+0x2d4/0x400 [btrfs] + [87452.331405] extent_write_cache_pages+0x2b2/0x500 [btrfs] + [87452.332007] ? lock_release+0x20e/0x4c0 + [87452.332557] ? trace_hardirqs_on+0x1b/0xf0 + [87452.333127] extent_writepages+0x43/0x90 [btrfs] + [87452.333653] ? lock_acquire+0x1a3/0x490 + [87452.334177] do_writepages+0x43/0xe0 + [87452.334699] ? __filemap_fdatawrite_range+0xa4/0x100 + [87452.335720] __filemap_fdatawrite_range+0xc5/0x100 + [87452.336500] btrfs_run_delalloc_work+0x17/0x40 [btrfs] + [87452.337216] btrfs_work_helper+0xf1/0x600 [btrfs] + [87452.337838] process_one_work+0x24e/0x5e0 + [87452.338437] worker_thread+0x50/0x3b0 + [87452.339137] ? process_one_work+0x5e0/0x5e0 + [87452.339884] kthread+0x153/0x170 + [87452.340507] ? kthread_mod_delayed_work+0xc0/0xc0 + [87452.341153] ret_from_fork+0x22/0x30 + [87452.341806] INFO: task kworker/u16:1:2426217 blocked for more than 120 seconds. + [87452.342487] Tainted: G B W 5.10.0-rc4-btrfs-next-73 #1 + [87452.343274] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. + [87452.344049] task:kworker/u16:1 state:D stack: 0 pid:2426217 ppid: 2 flags:0x00004000 + [87452.344974] Workqueue: events_unbound btrfs_async_reclaim_metadata_space [btrfs] + [87452.345655] Call Trace: + [87452.346305] __schedule+0x5d1/0xcf0 + [87452.346947] ? kvm_clock_read+0x14/0x30 + [87452.347676] ? wait_for_completion+0x81/0x110 + [87452.348389] schedule+0x45/0xe0 + [87452.349077] schedule_timeout+0x30c/0x580 + [87452.349718] ? _raw_spin_unlock_irqrestore+0x3c/0x60 + [87452.350340] ? lock_acquire+0x1a3/0x490 + [87452.351006] ? try_to_wake_up+0x7a/0xa20 + [87452.351541] ? lock_release+0x20e/0x4c0 + [87452.352040] ? lock_acquired+0x199/0x490 + [87452.352517] ? wait_for_completion+0x81/0x110 + [87452.353000] wait_for_completion+0xab/0x110 + [87452.353490] start_delalloc_inodes+0x2af/0x390 [btrfs] + [87452.353973] btrfs_start_delalloc_roots+0x12d/0x250 [btrfs] + [87452.354455] flush_space+0x24f/0x660 [btrfs] + [87452.355063] btrfs_async_reclaim_metadata_space+0x1bb/0x480 [btrfs] + [87452.355565] process_one_work+0x24e/0x5e0 + [87452.356024] worker_thread+0x20f/0x3b0 + [87452.356487] ? process_one_work+0x5e0/0x5e0 + [87452.356973] kthread+0x153/0x170 + [87452.357434] ? kthread_mod_delayed_work+0xc0/0xc0 + [87452.357880] ret_from_fork+0x22/0x30 + (...) + < stack traces of several tasks waiting for the locks of the inodes of the + clone operation > + (...) + [92867.444138] RSP: 002b:00007ffc3371bbe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000052 + [92867.444624] RAX: ffffffffffffffda RBX: 00007ffc3371bea0 RCX: 00007f61efe73f97 + [92867.445116] RDX: 0000000000000000 RSI: 0000560fbd5d7a40 RDI: 0000560fbd5d8960 + [92867.445595] RBP: 00007ffc3371beb0 R08: 0000000000000001 R09: 0000000000000003 + [92867.446070] R10: 00007ffc3371b996 R11: 0000000000000246 R12: 0000000000000000 + [92867.446820] R13: 000000000000001f R14: 00007ffc3371bea0 R15: 00007ffc3371beb0 + [92867.447361] task:fsstress state:D stack: 0 pid:2508238 ppid:2508153 flags:0x00004000 + [92867.447920] Call Trace: + [92867.448435] __schedule+0x5d1/0xcf0 + [92867.448934] ? _raw_spin_unlock_irqrestore+0x3c/0x60 + [92867.449423] schedule+0x45/0xe0 + [92867.449916] __reserve_bytes+0x4a4/0xb10 [btrfs] + [92867.450576] ? finish_wait+0x90/0x90 + [92867.451202] btrfs_reserve_metadata_bytes+0x29/0x190 [btrfs] + [92867.451815] btrfs_block_rsv_add+0x1f/0x50 [btrfs] + [92867.452412] start_transaction+0x2d1/0x760 [btrfs] + [92867.453216] clone_copy_inline_extent+0x333/0x490 [btrfs] + [92867.453848] ? lock_release+0x20e/0x4c0 + [92867.454539] ? btrfs_search_slot+0x9a7/0xc30 [btrfs] + [92867.455218] btrfs_clone+0x569/0x7e0 [btrfs] + [92867.455952] btrfs_clone_files+0xf6/0x150 [btrfs] + [92867.456588] btrfs_remap_file_range+0x324/0x3d0 [btrfs] + [92867.457213] do_clone_file_range+0xd4/0x1f0 + [92867.457828] vfs_clone_file_range+0x4d/0x230 + [92867.458355] ? lock_release+0x20e/0x4c0 + [92867.458890] ioctl_file_clone+0x8f/0xc0 + [92867.459377] do_vfs_ioctl+0x342/0x750 + [92867.459913] __x64_sys_ioctl+0x62/0xb0 + [92867.460377] do_syscall_64+0x33/0x80 + [92867.460842] entry_SYSCALL_64_after_hwframe+0x44/0xa9 + (...) + < stack traces of more tasks blocked on metadata reservation like the clone + task above, because the async reclaim task has deadlocked > + (...) + +Another thing to notice is that the worker task that is deadlocked when +trying to flush the destination inode of the clone operation is at +btrfs_invalidatepage(). This is simply because the clone operation has a +destination offset greater than the i_size and we only update the i_size +of the destination file after cloning an extent (just like we do in the +buffered write path). + +Since the async reclaim path uses btrfs_start_delalloc_roots() to trigger +the flushing of delalloc for all inodes that have delalloc, add a runtime +flag to an inode to signal it should not be flushed, and for inodes with +that flag set, start_delalloc_inodes() will simply skip them. When the +cloning code needs to dirty a page to copy an inline extent, set that flag +on the inode and then clear it when the clone operation finishes. + +This could be sporadically triggered with test case generic/269 from +fstests, which exercises many fsstress processes running in parallel with +several dd processes filling up the entire filesystem. + +CC: stable@vger.kernel.org # 5.9+ +Fixes: 05a5a7621ce6 ("Btrfs: implement full reflink support for inline extents") +Reviewed-by: Josef Bacik <josef@toxicpanda.com> +Signed-off-by: Filipe Manana <fdmanana@suse.com> +Reviewed-by: David Sterba <dsterba@suse.com> +Signed-off-by: David Sterba <dsterba@suse.com> +--- + fs/btrfs/btrfs_inode.h | 9 +++++++++ + fs/btrfs/ctree.h | 3 ++- + fs/btrfs/dev-replace.c | 2 +- + fs/btrfs/inode.c | 15 +++++++++++---- + fs/btrfs/ioctl.c | 2 +- + fs/btrfs/reflink.c | 15 +++++++++++++++ + fs/btrfs/space-info.c | 2 +- + 7 files changed, 40 insertions(+), 8 deletions(-) + +diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h +index 92dd86bceae3..7e86ab4841dd 100644 +--- a/fs/btrfs/btrfs_inode.h ++++ b/fs/btrfs/btrfs_inode.h +@@ -35,6 +35,15 @@ enum { + BTRFS_INODE_IN_DELALLOC_LIST, + BTRFS_INODE_HAS_PROPS, + BTRFS_INODE_SNAPSHOT_FLUSH, ++ /* ++ * Set when we are in a context where we need to start a transaction and ++ * have dirty pages with the respective file range locked. This is to ++ * ensure that when reserving space for the transaction, if we are low ++ * on available space and need to flush delalloc, we will not flush ++ * delalloc for this inode, because that could result in a deadlock (on ++ * the file range, inode's io_tree). ++ */ ++ BTRFS_INODE_NO_DELALLOC_FLUSH, + }; + + /* in memory btrfs inode */ +diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h +index 62461239600f..e01545538e07 100644 +--- a/fs/btrfs/ctree.h ++++ b/fs/btrfs/ctree.h +@@ -3001,7 +3001,8 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans, + u32 min_type); + + int btrfs_start_delalloc_snapshot(struct btrfs_root *root); +-int btrfs_start_delalloc_roots(struct btrfs_fs_info *fs_info, u64 nr); ++int btrfs_start_delalloc_roots(struct btrfs_fs_info *fs_info, u64 nr, ++ bool in_reclaim_context); + int btrfs_set_extent_delalloc(struct btrfs_inode *inode, u64 start, u64 end, + unsigned int extra_bits, + struct extent_state **cached_state); +diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c +index 10638537b9ef..d29780463182 100644 +--- a/fs/btrfs/dev-replace.c ++++ b/fs/btrfs/dev-replace.c +@@ -703,7 +703,7 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info, + * flush all outstanding I/O and inode extent mappings before the + * copy operation is declared as being finished + */ +- ret = btrfs_start_delalloc_roots(fs_info, U64_MAX); ++ ret = btrfs_start_delalloc_roots(fs_info, U64_MAX, false); + if (ret) { + mutex_unlock(&dev_replace->lock_finishing_cancel_unmount); + return ret; +diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c +index 7e8d8169779d..07479250221d 100644 +--- a/fs/btrfs/inode.c ++++ b/fs/btrfs/inode.c +@@ -9389,7 +9389,8 @@ static struct btrfs_delalloc_work *btrfs_alloc_delalloc_work(struct inode *inode + * some fairly slow code that needs optimization. This walks the list + * of all the inodes with pending delalloc and forces them to disk. + */ +-static int start_delalloc_inodes(struct btrfs_root *root, u64 *nr, bool snapshot) ++static int start_delalloc_inodes(struct btrfs_root *root, u64 *nr, bool snapshot, ++ bool in_reclaim_context) + { + struct btrfs_inode *binode; + struct inode *inode; +@@ -9410,6 +9411,11 @@ static int start_delalloc_inodes(struct btrfs_root *root, u64 *nr, bool snapshot + + list_move_tail(&binode->delalloc_inodes, + &root->delalloc_inodes); ++ ++ if (in_reclaim_context && ++ test_bit(BTRFS_INODE_NO_DELALLOC_FLUSH, &binode->runtime_flags)) ++ continue; ++ + inode = igrab(&binode->vfs_inode); + if (!inode) { + cond_resched_lock(&root->delalloc_lock); +@@ -9463,10 +9469,11 @@ int btrfs_start_delalloc_snapshot(struct btrfs_root *root) + if (test_bit(BTRFS_FS_STATE_ERROR, &fs_info->fs_state)) + return -EROFS; + +- return start_delalloc_inodes(root, &nr, true); ++ return start_delalloc_inodes(root, &nr, true, false); + } + +-int btrfs_start_delalloc_roots(struct btrfs_fs_info *fs_info, u64 nr) ++int btrfs_start_delalloc_roots(struct btrfs_fs_info *fs_info, u64 nr, ++ bool in_reclaim_context) + { + struct btrfs_root *root; + struct list_head splice; +@@ -9489,7 +9496,7 @@ int btrfs_start_delalloc_roots(struct btrfs_fs_info *fs_info, u64 nr) + &fs_info->delalloc_roots); + spin_unlock(&fs_info->delalloc_root_lock); + +- ret = start_delalloc_inodes(root, &nr, false); ++ ret = start_delalloc_inodes(root, &nr, false, in_reclaim_context); + btrfs_put_root(root); + if (ret < 0) + goto out; +diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c +index e8ca229a216b..bd46e107f955 100644 +--- a/fs/btrfs/ioctl.c ++++ b/fs/btrfs/ioctl.c +@@ -4940,7 +4940,7 @@ long btrfs_ioctl(struct file *file, unsigned int + case BTRFS_IOC_SYNC: { + int ret; + +- ret = btrfs_start_delalloc_roots(fs_info, U64_MAX); ++ ret = btrfs_start_delalloc_roots(fs_info, U64_MAX, false); + if (ret) + return ret; + ret = btrfs_sync_fs(inode->i_sb, 1); +diff --git a/fs/btrfs/reflink.c b/fs/btrfs/reflink.c +index 99aa87c08912..a646af95dd10 100644 +--- a/fs/btrfs/reflink.c ++++ b/fs/btrfs/reflink.c +@@ -89,6 +89,19 @@ static int copy_inline_to_page(struct btrfs_inode *inode, + if (ret) + goto out_unlock; + ++ /* ++ * After dirtying the page our caller will need to start a transaction, ++ * and if we are low on metadata free space, that can cause flushing of ++ * delalloc for all inodes in order to get metadata space released. ++ * However we are holding the range locked for the whole duration of ++ * the clone/dedupe operation, so we may deadlock if that happens and no ++ * other task releases enough space. So mark this inode as not being ++ * possible to flush to avoid such deadlock. We will clear that flag ++ * when we finish cloning all extents, since a transaction is started ++ * after finding each extent to clone. ++ */ ++ set_bit(BTRFS_INODE_NO_DELALLOC_FLUSH, &inode->runtime_flags); ++ + if (comp_type == BTRFS_COMPRESS_NONE) { + char *map; + +@@ -547,6 +560,8 @@ static int btrfs_clone(struct inode *src, struct inode *inode, + out: + btrfs_free_path(path); + kvfree(buf); ++ clear_bit(BTRFS_INODE_NO_DELALLOC_FLUSH, &BTRFS_I(inode)->runtime_flags); ++ + return ret; + } + +diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c +index 64099565ab8f..67e55c5479b8 100644 +--- a/fs/btrfs/space-info.c ++++ b/fs/btrfs/space-info.c +@@ -532,7 +532,7 @@ static void shrink_delalloc(struct btrfs_fs_info *fs_info, + + loops = 0; + while ((delalloc_bytes || dio_bytes) && loops < 3) { +- btrfs_start_delalloc_roots(fs_info, items); ++ btrfs_start_delalloc_roots(fs_info, items, true); + + loops++; + if (wait_ordered && !trans) { +-- +2.30.0 + diff --git a/0005-btrfs-Fix-500-2000-performance-regression-w-5.10.patch b/0005-btrfs-Fix-500-2000-performance-regression-w-5.10.patch deleted file mode 100644 index c4bdae79103..00000000000 --- a/0005-btrfs-Fix-500-2000-performance-regression-w-5.10.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 0128c7314a4d856461caacfdd528a7bffa03d41e Mon Sep 17 00:00:00 2001 -From: Josef Bacik <josef@toxicpanda.com> -Date: Wed, 23 Dec 2020 14:41:00 -0500 -Subject: [PATCH 5/8] btrfs: Fix 500-2000% performance regression w/ 5.10 - -Josef's tentative fix from -https://lore.kernel.org/linux-btrfs/0382080a1836a12c2d625f8a5bf899828eba204b.1608752315.git.josef@toxicpanda.com/ - -With the conflict fix mentioned in the reply. - -For https://bugs.archlinux.org/task/69077 ---- - fs/btrfs/space-info.c | 25 ++++++++++++++++++++++++- - 1 file changed, 24 insertions(+), 1 deletion(-) - -diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c -index 64099565ab8f..8a1ce11b6ed8 100644 ---- a/fs/btrfs/space-info.c -+++ b/fs/btrfs/space-info.c -@@ -480,6 +480,28 @@ static inline u64 calc_reclaim_items_nr(struct btrfs_fs_info *fs_info, - - #define EXTENT_SIZE_PER_ITEM SZ_256K - -+static void btrfs_writeback_inodes_sb_nr(struct btrfs_fs_info *fs_info, -+ unsigned long nr_pages, u64 nr_items) -+{ -+ struct super_block *sb = fs_info->sb; -+ -+ if (down_read_trylock(&sb->s_umount)) { -+ writeback_inodes_sb_nr(sb, nr_pages, WB_REASON_FS_FREE_SPACE); -+ up_read(&sb->s_umount); -+ } else { -+ /* -+ * We needn't worry the filesystem going from r/w to r/o though -+ * we don't acquire ->s_umount mutex, because the filesystem -+ * should guarantee the delalloc inodes list be empty after -+ * the filesystem is readonly(all dirty pages are written to -+ * the disk). -+ */ -+ btrfs_start_delalloc_roots(fs_info, nr_items); -+ if (!current->journal_info) -+ btrfs_wait_ordered_roots(fs_info, nr_items, 0, (u64)-1); -+ } -+} -+ - /* - * shrink metadata reservation for delalloc - */ -@@ -532,7 +554,8 @@ static void shrink_delalloc(struct btrfs_fs_info *fs_info, - - loops = 0; - while ((delalloc_bytes || dio_bytes) && loops < 3) { -- btrfs_start_delalloc_roots(fs_info, items); -+ unsigned long nr_pages = min(delalloc_bytes, to_reclaim) >> PAGE_SHIFT; -+ btrfs_writeback_inodes_sb_nr(fs_info, nr_pages, items); - - loops++; - if (wait_ordered && !trans) { --- -2.30.0 - diff --git a/0005-btrfs-shrink-delalloc-pages-instead-of-full-inodes.patch b/0005-btrfs-shrink-delalloc-pages-instead-of-full-inodes.patch new file mode 100644 index 00000000000..e06f23cc27e --- /dev/null +++ b/0005-btrfs-shrink-delalloc-pages-instead-of-full-inodes.patch @@ -0,0 +1,184 @@ +From 0397aa4e6205543d9b3da11794037e94f8735867 Mon Sep 17 00:00:00 2001 +From: Josef Bacik <josef@toxicpanda.com> +Date: Mon, 4 Jan 2021 15:24:11 -0500 +Subject: [PATCH 5/6] btrfs: shrink delalloc pages instead of full inodes +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Commit 38d715f494f2 ("btrfs: use btrfs_start_delalloc_roots in +shrink_delalloc") cleaned up how we do delalloc shrinking by utilizing +some infrastructure we have in place to flush inodes that we use for +device replace and snapshot. However this introduced a pretty serious +performance regression. The root cause is because before we would +generally use the normal writeback path to reclaim delalloc space, and +for this we would provide it with the number of pages we wanted to +flush. The referenced commit changed this to flush that many inodes, +which drastically increased the amount of space we were flushing in +certain cases, which severely affected performance. + +We cannot revert this patch unfortunately, because Filipe has another +fix that requires the ability to skip flushing inodes that are being +cloned in certain scenarios, which means we need to keep using our +flushing infrastructure or risk re-introducing the deadlock. + +Instead to fix this problem we can go back to providing +btrfs_start_delalloc_roots with a number of pages to flush, and then set +up a writeback_control and utilize sync_inode() to handle the flushing +for us. This gives us the same behavior we had prior to the fix, while +still allowing us to avoid the deadlock that was fixed by Filipe. The +user reported reproducer was a simple untarring of a large tarball of +the source code for Firefox. The results are as follows + +5.9 0m54.258s +5.10 1m26.212s +Patch 0m38.800s + +We are significantly faster because of the work I did around improving +ENOSPC flushing in 5.10 and 5.11, so reverting to the previous write out +behavior gave us a pretty big boost. + +CC: stable@vger.kernel.org # 5.10 +Reported-by: René Rebe <rene@exactcode.de> +Fixes: 38d715f494f2 ("btrfs: use btrfs_start_delalloc_roots in shrink_delalloc") +Signed-off-by: Josef Bacik <josef@toxicpanda.com> +--- + fs/btrfs/inode.c | 60 +++++++++++++++++++++++++++++++------------ + fs/btrfs/space-info.c | 4 ++- + 2 files changed, 46 insertions(+), 18 deletions(-) + +diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c +index 07479250221d..acc47e2ffb46 100644 +--- a/fs/btrfs/inode.c ++++ b/fs/btrfs/inode.c +@@ -9389,7 +9389,8 @@ static struct btrfs_delalloc_work *btrfs_alloc_delalloc_work(struct inode *inode + * some fairly slow code that needs optimization. This walks the list + * of all the inodes with pending delalloc and forces them to disk. + */ +-static int start_delalloc_inodes(struct btrfs_root *root, u64 *nr, bool snapshot, ++static int start_delalloc_inodes(struct btrfs_root *root, ++ struct writeback_control *wbc, bool snapshot, + bool in_reclaim_context) + { + struct btrfs_inode *binode; +@@ -9398,6 +9399,7 @@ static int start_delalloc_inodes(struct btrfs_root *root, u64 *nr, bool snapshot + struct list_head works; + struct list_head splice; + int ret = 0; ++ bool full_flush = wbc->nr_to_write == LONG_MAX; + + INIT_LIST_HEAD(&works); + INIT_LIST_HEAD(&splice); +@@ -9426,18 +9428,24 @@ static int start_delalloc_inodes(struct btrfs_root *root, u64 *nr, bool snapshot + if (snapshot) + set_bit(BTRFS_INODE_SNAPSHOT_FLUSH, + &binode->runtime_flags); +- work = btrfs_alloc_delalloc_work(inode); +- if (!work) { +- iput(inode); +- ret = -ENOMEM; +- goto out; +- } +- list_add_tail(&work->list, &works); +- btrfs_queue_work(root->fs_info->flush_workers, +- &work->work); +- if (*nr != U64_MAX) { +- (*nr)--; +- if (*nr == 0) ++ if (full_flush) { ++ work = btrfs_alloc_delalloc_work(inode); ++ if (!work) { ++ iput(inode); ++ ret = -ENOMEM; ++ goto out; ++ } ++ list_add_tail(&work->list, &works); ++ btrfs_queue_work(root->fs_info->flush_workers, ++ &work->work); ++ } else { ++ ret = sync_inode(inode, wbc); ++ if (!ret && ++ test_bit(BTRFS_INODE_HAS_ASYNC_EXTENT, ++ &BTRFS_I(inode)->runtime_flags)) ++ ret = sync_inode(inode, wbc); ++ btrfs_add_delayed_iput(inode); ++ if (ret || wbc->nr_to_write <= 0) + goto out; + } + cond_resched(); +@@ -9463,18 +9471,29 @@ static int start_delalloc_inodes(struct btrfs_root *root, u64 *nr, bool snapshot + + int btrfs_start_delalloc_snapshot(struct btrfs_root *root) + { ++ struct writeback_control wbc = { ++ .nr_to_write = LONG_MAX, ++ .sync_mode = WB_SYNC_NONE, ++ .range_start = 0, ++ .range_end = LLONG_MAX, ++ }; + struct btrfs_fs_info *fs_info = root->fs_info; +- u64 nr = U64_MAX; + + if (test_bit(BTRFS_FS_STATE_ERROR, &fs_info->fs_state)) + return -EROFS; + +- return start_delalloc_inodes(root, &nr, true, false); ++ return start_delalloc_inodes(root, &wbc, true, false); + } + + int btrfs_start_delalloc_roots(struct btrfs_fs_info *fs_info, u64 nr, + bool in_reclaim_context) + { ++ struct writeback_control wbc = { ++ .nr_to_write = (nr == U64_MAX) ? LONG_MAX : (unsigned long)nr, ++ .sync_mode = WB_SYNC_NONE, ++ .range_start = 0, ++ .range_end = LLONG_MAX, ++ }; + struct btrfs_root *root; + struct list_head splice; + int ret; +@@ -9488,6 +9507,13 @@ int btrfs_start_delalloc_roots(struct btrfs_fs_info *fs_info, u64 nr, + spin_lock(&fs_info->delalloc_root_lock); + list_splice_init(&fs_info->delalloc_roots, &splice); + while (!list_empty(&splice) && nr) { ++ /* ++ * Reset nr_to_write here so we know that we're doing a full ++ * flush. ++ */ ++ if (nr == U64_MAX) ++ wbc.nr_to_write = LONG_MAX; ++ + root = list_first_entry(&splice, struct btrfs_root, + delalloc_root); + root = btrfs_grab_root(root); +@@ -9496,9 +9522,9 @@ int btrfs_start_delalloc_roots(struct btrfs_fs_info *fs_info, u64 nr, + &fs_info->delalloc_roots); + spin_unlock(&fs_info->delalloc_root_lock); + +- ret = start_delalloc_inodes(root, &nr, false, in_reclaim_context); ++ ret = start_delalloc_inodes(root, &wbc, false, in_reclaim_context); + btrfs_put_root(root); +- if (ret < 0) ++ if (ret < 0 || wbc.nr_to_write <= 0) + goto out; + spin_lock(&fs_info->delalloc_root_lock); + } +diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c +index 67e55c5479b8..e8347461c8dd 100644 +--- a/fs/btrfs/space-info.c ++++ b/fs/btrfs/space-info.c +@@ -532,7 +532,9 @@ static void shrink_delalloc(struct btrfs_fs_info *fs_info, + + loops = 0; + while ((delalloc_bytes || dio_bytes) && loops < 3) { +- btrfs_start_delalloc_roots(fs_info, items, true); ++ u64 nr_pages = min(delalloc_bytes, to_reclaim) >> PAGE_SHIFT; ++ ++ btrfs_start_delalloc_roots(fs_info, nr_pages, true); + + loops++; + if (wait_ordered && !trans) { +-- +2.30.0 + diff --git a/0007-ALSA-hda-hdmi-fix-locking-in-silent_stream_disable.patch b/0007-ALSA-hda-hdmi-fix-locking-in-silent_stream_disable.patch deleted file mode 100644 index e06f6ce72ea..00000000000 --- a/0007-ALSA-hda-hdmi-fix-locking-in-silent_stream_disable.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 00f09a6a8193b46c83ae1c8ff6623db011f90099 Mon Sep 17 00:00:00 2001 -From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org> -Date: Fri, 1 Jan 2021 06:20:32 +0100 -Subject: [PATCH 7/8] ALSA: hda/hdmi: fix locking in silent_stream_disable - -The code unlocked the wrong lock, leading to deadlocks. ---- - sound/pci/hda/patch_hdmi.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c -index 2ddc27db8c01..d12b4799c3cb 100644 ---- a/sound/pci/hda/patch_hdmi.c -+++ b/sound/pci/hda/patch_hdmi.c -@@ -1736,7 +1736,7 @@ static void silent_stream_disable(struct hda_codec *codec, - per_pin->silent_stream = false; - - unlock_out: -- mutex_unlock(&spec->pcm_lock); -+ mutex_unlock(&per_pin->lock); - } - - /* update ELD and jack state via audio component */ --- -2.30.0 - @@ -7,7 +7,7 @@ _srcname=linux-5.10 _major=5.10 ### on initial release this is null otherwise it is the current stable subversion ### ie 1,2,3 corresponding $_major.1, $_major.3 etc -_minor=4 +_minor=6 _minorc=$((_minor+1)) ### on initial release this is just $_major _fullver=$_major.$_minor @@ -22,6 +22,7 @@ makedepends=( bc kmod libelf cpio perl tar xz ) options=('!strip') +_modprobeddb= source=( https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/"$_rcpatch".{xz,sign} # https://lkml.org/lkml/2019/8/23/712 @@ -29,28 +30,26 @@ source=( https://www.kernel.org/pub/linux/kernel/v5.x/linux-$_fullver.tar.{xz,sign} config # the main kernel config file 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch -0002-Bluetooth-Fix-attempting-to-set-RPA-timeout-when-uns.patch -0003-HID-quirks-Add-Apple-Magic-Trackpad-2-to-hid_have_sp.patch -0005-btrfs-Fix-500-2000-performance-regression-w-5.10.patch -0006-iwlwifi-Fix-regression-from-UDP-segmentation-support.patch -0007-ALSA-hda-hdmi-fix-locking-in-silent_stream_disable.patch +0002-HID-quirks-Add-Apple-Magic-Trackpad-2-to-hid_have_sp.patch +0003-iwlwifi-Fix-regression-from-UDP-segmentation-support.patch +0004-btrfs-fix-deadlock-when-cloning-inline-extent-and-lo.patch +0005-btrfs-shrink-delalloc-pages-instead-of-full-inodes.patch ) validpgpkeys=( 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman ) -b2sums=('3a4fa6e77721b0dc3b74e0e1c6d6af2aaf33286d5fc3bf6e0ae844cbed2f745cfa3fa8a83b406082e1e981125cf1c09a5df765e990a132713e7a05281a936394' +b2sums=('d751bad7450ea12ea43b4565093d1da2ac0c4e1ecd4d50de3096a7d0a9717e8781b93cfbb156edc859f2c38805ab2d0fc71d7d6c128fdbe415cd5e5aff3f2dde' 'SKIP' - '57f6d719451aacfd298452703ae02e6188885500e8cdf18fffa6b9967b0934a23cd378ab4c49b76ccb2f7a9012d6aa7ff1349d488cb31e40924be2f27b244cec' + '2da9e47f6524ecb50db9f515b9f281f08fbcb323f6e4ddb225c2b2f6379787c37efee25589e49286e13ff663c414a422b680912739400afab89f0ebaf741d33b' 'SKIP' 'cb3a58e4eef8395b75887d94a84bba25f05fbec8f576a791623057a190a1d51b412a19ecf1b600ac3f9f6c46968eb0e130d571743e61afc231a97146ee4b52d0' - '7d2ef86a15ead6c946051c117a8ed97056e92a25a274455c5cc62ec65ff92bda7a50032b32c8019180f233a54e778becc45751741ae4d87db8f56ef520ca1e83' - '8ea9d2b7809728c3de05768fea5d8838fe20de8aaaed9106f26c0e8fc051921668d0c31345f200d06005403dec565690f828dbbcd38504079fe6fccbf742be61' - 'd361b313a3dcd761833b8e2e40201df5e5b93c472e8a06f4684feb24d6e174405e6e4328dc0c449b9b0263e87224b3e1f4a52c873b666a93055979c9d2e2bf59' - '2853fa5257b96b11bcbf60ed68df09938ebb15f81c1bb6aa763c721c4e55f440fd27f9a6b49e8f9a1788948928299810f9e8ea43f0759b06cae3dd140902f93e' - '46a30c86206717fe6804d8e88693b90382b07fdad91d8fd7220e398e41f87a4b5cb5be70285241a3fc81c62ced6021f1710ce0426f3161285c254db9e5484d86' - 'eec26b472efda62e27d26c2033158e970a5eadb30d38fc4de59c36fafe53efc1e220b7d57189abcd5a2697d242df8475cf2eebfd1ad6373804b5456dbcc14098') + 'b42730a806a63dbf905f448a3282dec72a950ef7d16a3531d977dcae3b5c2685a5c5dd10a58e345d57084a6212353dc2f2f0102021d13c1557092e564f81eaf5' + 'a5dea5bb6df6fb517009ad5b104c2ea8e93ed880393a1412ca2d7fc8047abccc9c72076e40d1d4133cadc9048040846cc9bdc91e30c4d601ad5963d13498503e' + '9a8723104239ba4646dd0c76c5a60128892954dd2faee69ca5c5d1251c9694de8fd528ca063a2add1401ad1375ad0dcc2560ca03a1bfd03b161d34ccd25b686a' + 'e0da90b08fb03658dca9c42ac287c04d9b35969a15165c0f1fc7e11290de272b892abb58f5c7aabe22899f53f5bc39539f58768b8012d92145ba2fd8b89898a7' + '2b180269f934469d6ef6f0f8474dd947c7a8e9344cf3bbecac6a9c325d7bfb89d234eb15c4422709acaffd30ebeda2ec06c91a8c1128631a839186e8b273eb65') export KBUILD_BUILD_HOST=archlinux @@ -60,7 +59,7 @@ export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EP prepare() { cd linux-${_fullver} - echo "Setting version..." + msg2 "Setting version..." scripts/setlocalversion --save-scmversion echo "-$pkgrel" > localversion.10-pkgrel echo "${pkgbase#linux}" > localversion.20-pkgname @@ -72,7 +71,7 @@ prepare() { for src in "${source[@]}"; do src="${src%%::*}" src="${src##*/}" - [[ $src = *.patch ]] || continue + [[ $src = 0*.patch ]] || continue echo "Applying patch $src..." patch -Np1 < "../$src" done @@ -84,10 +83,35 @@ prepare() { # and can easily overwhelm a system with 32 GB of memory using a tmpfs build # partition ... this was introduced by FS#66260, see: # https://git.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/linux&id=663b08666b269eeeeaafbafaee07fd03389ac8d7 - sed -i -e 's/CONFIG_DEBUG_INFO=y/# CONFIG_DEBUG_INFO is not set/' \ + sed -i -e 's/CONFIG_CGROUP_BPF=y/# CONFIG_CGROUP_BPF is not set/' \ + -i -e 's/CONFIG_BPF_LSM=y/# CONFIG_BPF_LSM is not set/' \ + -i -e 's/CONFIG_USERMODE_DRIVER=y/# CONFIG_BPF_PRELOAD is not set/' \ + -i -e '/CONFIG_BPF_PRELOAD=y/d' \ + -i -e '/CONFIG_BPF_PRELOAD_UMD=m/d' \ + -i -e '/CONFIG_BPF_STREAM_PARSER=y/g' \ + -i -e 's/CONFIG_BPF_LIRC_MODE2=y/# CONFIG_BPF_LIRC_MODE2 is not set/' \ + -i -e 's/CONFIG_DEBUG_INFO=y/# CONFIG_DEBUG_INFO is not set/' \ + -i -e '/# CONFIG_DEBUG_INFO_REDUCED is not set/d' \ + -i -e '/# CONFIG_DEBUG_INFO_COMPRESSED is not set/d' \ + -i -e '/# CONFIG_DEBUG_INFO_SPLIT is not set/d' \ -i -e '/CONFIG_DEBUG_INFO_DWARF4=y/d' \ - -i -e '/CONFIG_DEBUG_INFO_BTF=y/d' ./.config - + -i -e '/CONFIG_DEBUG_INFO_BTF=y/d' \ + -i -e '/# CONFIG_GDB_SCRIPTS is not set/d' \ + -i -e 's/CONFIG_BPF_KPROBE_OVERRIDE=y/# CONFIG_BPF_KPROBE_OVERRIDE is not set/' ./.config + + if [[ -n "$_modprobeddb" ]]; then + #msg "Running Steven Rostedt's make localmodconfig now" + #sudo /usr/bin/modprobed-db recall + #make localmodconfig + msg "Running Steven Rostedt's make localmodconfig now" + if [[ -f $HOME/.config/modprobed.db ]]; then + _useit="$HOME/.config/modprobed.db" + else + _useit="../modprobed.db" + fi + make LSMOD="$_useit" localmodconfig + fi + make olddefconfig # make nconfig @@ -121,7 +145,10 @@ _package() { echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase" echo "Installing modules..." - make INSTALL_MOD_PATH="$pkgdir/usr" INSTALL_MOD_STRIP=1 modules_install + #make INSTALL_MOD_PATH="$pkgdir/usr" INSTALL_MOD_STRIP=1 modules_install + # not needed since not building with CONFIG_DEBUG_INFO=y + + make INSTALL_MOD_PATH="$pkgdir/usr" modules_install # remove build and source links rm "$modulesdir"/{source,build} @@ -199,6 +226,7 @@ _package-headers() { #echo "Stripping vmlinux..." #strip -v $STRIP_STATIC "$builddir/vmlinux" + # not needed since not building with CONFIG_DEBUG_INFO=y echo "Adding symlink..." mkdir -p "$pkgdir/usr/src" |