Bug 213249 - Processes stuck in disk sleep while accessing files on a bcache drive
Summary: Processes stuck in disk sleep while accessing files on a bcache drive
Status: RESOLVED DUPLICATE of bug 213181
Alias: None
Product: IO/Storage
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: io_other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-28 00:02 UTC by Troy
Modified: 2021-06-05 16:31 UTC (History)
1 user (show)

See Also:
Kernel Version: 5.12.7
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments

Description Troy 2021-05-28 00:02:21 UTC
This issue occurs in the 5.12.x branch. Doesn't occur in kernal version 5.11.16. Browsing through images in gwenview shortly freezes gwenview. The same occurs when running a game on Steam. The respective processes enter disk sleep (i.e. kworker, wineserver, file.so, thumbnail.so, or gwenview). The computer requires a hard reset to reboot. The files are stored on a HDD+SSD bcache.

[  197.925278] ------------[ cut here ]------------
[  197.925280] kernel BUG at block/bio.c:52!
[  197.925285] invalid opcode: 0000 [#1] PREEMPT SMP PTI
[  197.925287] CPU: 9 PID: 6058 Comm: CGenericAsyncFi Tainted: G           OE     5.12.7-arch1-1 #1
[  197.925289] Hardware name: System manufacturer System Product Name/ROG MAXIMUS X CODE, BIOS 2503 09/25/2020
[  197.925290] RIP: 0010:biovec_slab.part.0+0x5/0x10
[  197.925294] Code: 71 19 63 00 48 8b 6b f0 48 85 ed 75 ca 5b 4c 89 e7 5d 41 5c e9 3c 19 63 00 48 c7 43 f8 00 00 00 00 eb c1 66 90 0f 1f 44 00 00 <0f> 0b 66 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 83 7f 40 00 75
[  197.925296] RSP: 0018:ffff9ca5c3767650 EFLAGS: 00210212
[  197.925298] RAX: 0000000000000080 RBX: ffff9ca5c3767684 RCX: 0000000000000100
[  197.925299] RDX: 0000000000000800 RSI: ffff9ca5c3767684 RDI: ffff8e060bf10118
[  197.925300] RBP: 0000000000000800 R08: ffff8e060bf10118 R09: ffff8e061cd24300
[  197.925300] R10: ffff8e060c36b000 R11: 0000000000000000 R12: ffff8e060bf10118
[  197.925301] R13: 0000000000000800 R14: 0000000000000800 R15: ffff8e060bf100d0
[  197.925302] FS:  0000000000000000(0000) GS:ffff8e0d4ec40000(0063) knlGS:00000000b80aaac0
[  197.925304] CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
[  197.925305] CR2: 00000000af852000 CR3: 00000001c5aba003 CR4: 00000000003706e0
[  197.925306] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  197.925306] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[  197.925307] Call Trace:
[  197.925309]  bvec_alloc+0x90/0xc0
[  197.925312]  bio_alloc_bioset+0x1b3/0x260
[  197.925315]  cached_dev_cache_miss+0xf6/0x2f0 [bcache]
[  197.925327]  cache_lookup_fn+0x136/0x310 [bcache]
[  197.925335]  ? bch_data_invalidate+0x190/0x190 [bcache]
[  197.925342]  bch_btree_map_keys_recurse+0x9f/0x1a0 [bcache]
[  197.925349]  ? bch_data_invalidate+0x190/0x190 [bcache]
[  197.925356]  bch_btree_map_keys_recurse+0x11a/0x1a0 [bcache]
[  197.925363]  bch_btree_map_keys+0x1cb/0x1f0 [bcache]
[  197.925369]  ? bch_data_invalidate+0x190/0x190 [bcache]
[  197.925376]  cache_lookup+0xa1/0x160 [bcache]
[  197.925382]  cached_dev_submit_bio+0x9aa/0xd20 [bcache]
[  197.925390]  submit_bio_noacct+0x139/0x530
[  197.925392]  submit_bio+0x78/0x1d0
[  197.925394]  ext4_mpage_readpages+0x320/0x8c0 [ext4]
[  197.925416]  ? __mod_memcg_lruvec_state+0x22/0xe0
[  197.925419]  ? __add_to_page_cache_locked+0x194/0x3e0
[  197.925421]  read_pages+0xba/0x2a0
[  197.925424]  page_cache_ra_unbounded+0x13f/0x200
[  197.925426]  filemap_get_pages+0xf8/0x5f0
[  197.925428]  ? terminate_walk+0x61/0xf0
[  197.925430]  filemap_read+0xb9/0x350
[  197.925432]  new_sync_read+0x152/0x1e0
[  197.925436]  vfs_read+0x147/0x1a0
[  197.925438]  ksys_read+0x67/0xe0
[  197.925440]  __do_fast_syscall_32+0x5c/0x90
[  197.925442]  do_fast_syscall_32+0x2f/0x70
[  197.925444]  entry_SYSENTER_compat_after_hwframe+0x4d/0x5f
[  197.925447] RIP: 0023:0xf7f00549
[  197.925448] Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00
[  197.925450] RSP: 002b:00000000b80a8df0 EFLAGS: 00200286 ORIG_RAX: 0000000000000003
[  197.925451] RAX: ffffffffffffffda RBX: 0000000000000057 RCX: 00000000af6ff010
[  197.925452] RDX: 0000000000100000 RSI: 00000000f7cdfe70 RDI: 0000000000000000
[  197.925453] RBP: 0000000000000057 R08: 0000000000000000 R09: 0000000000000000
[  197.925454] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
[  197.925454] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
[  197.925456] Modules linked in: udp_diag tcp_diag inet_diag snd_seq_dummy snd_seq snd_seq_device rfcomm xt_CHECKSUM xt_MASQUERADE xt_conntrack ipt_REJECT nf_reject_ipv4 xt_tcpudp ip6table_mangle ip6table_nat ip6table_filter ip6_tables iptable_mangle iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c iptable_filter cmac algif_hash algif_skcipher bridge af_alg joydev mousedev 8021q garp v4l2loopback_dc(OE) mrp stp bnep llc v4l2loopback(OE) btusb btrtl btbcm btintel intel_rapl_msr intel_rapl_common bluetooth ecdh_generic razermouse(OE) ecc x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel nls_iso8859_1 rtw88_8822be vfat rtw88_8822b fat eeepc_wmi usbhid rtw88_pci asus_wmi mei_hdcp wmi_bmof sparse_keymap mxm_wmi kvm rtw88_core snd_hda_codec_realtek iTCO_wdt intel_pmc_bxt ee1004 iTCO_vendor_support irqbypass snd_hda_codec_generic crct10dif_pclmul crc32_pclmul ghash_clmulni_intel mac80211 ledtrig_audio aesni_intel snd_hda_codec_hdmi crypto_simd cryptd snd_hda_intel
[  197.925496]  rapl snd_intel_dspcfg intel_cstate cfg80211 intel_uncore e1000e snd_intel_sdw_acpi snd_hda_codec pcspkr snd_hda_core mei_me rfkill libarc4 mei snd_hwdep wmi video acpi_pad mac_hid vboxnetflt(OE) vboxnetadp(OE) vboxdrv(OE) i2c_i801 i2c_smbus i2c_dev snd_aloop snd_pcm snd_timer snd soundcore videodev mc fuse crypto_user bpf_preload ip_tables x_tables ext4 crc32c_generic crc16 mbcache jbd2 crc32c_intel bcache crc64 xhci_pci xhci_pci_renesas amdgpu drm_ttm_helper ttm gpu_sched i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops cec drm agpgart [last unloaded: v4l2loopback_dc]
[  197.925521] ---[ end trace c75699d0493a7cac ]---
[  197.925522] RIP: 0010:biovec_slab.part.0+0x5/0x10
[  197.925525] Code: 71 19 63 00 48 8b 6b f0 48 85 ed 75 ca 5b 4c 89 e7 5d 41 5c e9 3c 19 63 00 48 c7 43 f8 00 00 00 00 eb c1 66 90 0f 1f 44 00 00 <0f> 0b 66 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 83 7f 40 00 75
[  197.925526] RSP: 0018:ffff9ca5c3767650 EFLAGS: 00210212
[  197.925540] RAX: 0000000000000080 RBX: ffff9ca5c3767684 RCX: 0000000000000100
[  197.925541] RDX: 0000000000000800 RSI: ffff9ca5c3767684 RDI: ffff8e060bf10118
[  197.925542] RBP: 0000000000000800 R08: ffff8e060bf10118 R09: ffff8e061cd24300
[  197.925543] R10: ffff8e060c36b000 R11: 0000000000000000 R12: ffff8e060bf10118
[  197.925544] R13: 0000000000000800 R14: 0000000000000800 R15: ffff8e060bf100d0
[  197.925545] FS:  0000000000000000(0000) GS:ffff8e0d4ec40000(0063) knlGS:00000000b80aaac0
[  197.925546] CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
[  197.925547] CR2: 00000000af852000 CR3: 00000001c5aba003 CR4: 00000000003706e0
[  197.925548] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  197.925549] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
'''
Comment 1 Troy 2021-05-28 19:44:22 UTC
Behavior with Gwenview occurred on a custom kernel with the OpenRGB patch and the following config options enabled for an android emulator:

CONFIG_ASHMEM=y
CONFIG_ANDROID=y
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ANDROID_BINDERFS=y
CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder"

After shifting through 5-10 images in Gwenview, Gwenview entered disk sleep. Gwenview behaves correctly on the stock kernel.

The bug still occurs when launching a game on Steam
Steam displays a dialog box with the text:
Preparing to launch [GAME NAME]
The game never launches.

Tested with Disgaea PC, NieR:Automata, and Middle-earth: Shadow of War with the same result.
Each game launch produces the same journal entry above with the same behavior. 
Installing a game to the boot SSD launches the game correctly

bcache_writebac enters disk sleep as well.

Editing documents and deleting files works before the bug occurs. After a process has entered disk sleep, files can sometimes be viewed but saving changes does not work. Deleting files on the bcache drive also does not work after the bug occurs.
Comment 2 Troy 2021-06-05 16:31:40 UTC

*** This bug has been marked as a duplicate of bug 213181 ***

Note You need to log in before you can comment on or make changes to this bug.