Revision 74c42e1baacf206338b1dd6b6199ac964512b5bb authored by Rongwei Wang on 28 October 2021, 21:36:27 UTC, committed by Linus Torvalds on 29 October 2021, 00:18:55 UTC
Currently collapse_file does not explicitly check PG_writeback, instead, page_has_private and try_to_release_page are used to filter writeback pages. This does not work for xfs with blocksize equal to or larger than pagesize, because in such case xfs has no page->private. This makes collapse_file bail out early for writeback page. Otherwise, xfs end_page_writeback will panic as follows. page:fffffe00201bcc80 refcount:0 mapcount:0 mapping:ffff0003f88c86a8 index:0x0 pfn:0x84ef32 aops:xfs_address_space_operations [xfs] ino:30000b7 dentry name:"libtest.so" flags: 0x57fffe0000008027(locked|referenced|uptodate|active|writeback) raw: 57fffe0000008027 ffff80001b48bc28 ffff80001b48bc28 ffff0003f88c86a8 raw: 0000000000000000 0000000000000000 00000000ffffffff ffff0000c3e9a000 page dumped because: VM_BUG_ON_PAGE(((unsigned int) page_ref_count(page) + 127u <= 127u)) page->mem_cgroup:ffff0000c3e9a000 ------------[ cut here ]------------ kernel BUG at include/linux/mm.h:1212! Internal error: Oops - BUG: 0 [#1] SMP Modules linked in: BUG: Bad page state in process khugepaged pfn:84ef32 xfs(E) page:fffffe00201bcc80 refcount:0 mapcount:0 mapping:0 index:0x0 pfn:0x84ef32 libcrc32c(E) rfkill(E) aes_ce_blk(E) crypto_simd(E) ... CPU: 25 PID: 0 Comm: swapper/25 Kdump: loaded Tainted: ... pstate: 60400005 (nZCv daif +PAN -UAO -TCO BTYPE=--) Call trace: end_page_writeback+0x1c0/0x214 iomap_finish_page_writeback+0x13c/0x204 iomap_finish_ioend+0xe8/0x19c iomap_writepage_end_bio+0x38/0x50 bio_endio+0x168/0x1ec blk_update_request+0x278/0x3f0 blk_mq_end_request+0x34/0x15c virtblk_request_done+0x38/0x74 [virtio_blk] blk_done_softirq+0xc4/0x110 __do_softirq+0x128/0x38c __irq_exit_rcu+0x118/0x150 irq_exit+0x1c/0x30 __handle_domain_irq+0x8c/0xf0 gic_handle_irq+0x84/0x108 el1_irq+0xcc/0x180 arch_cpu_idle+0x18/0x40 default_idle_call+0x4c/0x1a0 cpuidle_idle_call+0x168/0x1e0 do_idle+0xb4/0x104 cpu_startup_entry+0x30/0x9c secondary_start_kernel+0x104/0x180 Code: d4210000 b0006161 910c8021 94013f4d (d4210000) ---[ end trace 4a88c6a074082f8c ]--- Kernel panic - not syncing: Oops - BUG: Fatal exception in interrupt Link: https://lkml.kernel.org/r/20211022023052.33114-1-rongwei.wang@linux.alibaba.com Fixes: 99cb0dbd47a1 ("mm,thp: add read-only THP support for (non-shmem) FS") Signed-off-by: Rongwei Wang <rongwei.wang@linux.alibaba.com> Signed-off-by: Xu Yu <xuyu@linux.alibaba.com> Suggested-by: Yang Shi <shy828301@gmail.com> Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Yang Shi <shy828301@gmail.com> Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Song Liu <song@kernel.org> Cc: William Kucharski <william.kucharski@oracle.com> Cc: Hugh Dickins <hughd@google.com> Cc: Mike Kravetz <mike.kravetz@oracle.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent ffb29b1
File | Mode | Size |
---|---|---|
partitions | ||
Kconfig | -rw-r--r-- | 6.6 KB |
Kconfig.iosched | -rw-r--r-- | 1.3 KB |
Makefile | -rw-r--r-- | 1.7 KB |
badblocks.c | -rw-r--r-- | 14.1 KB |
bdev.c | -rw-r--r-- | 26.9 KB |
bfq-cgroup.c | -rw-r--r-- | 38.7 KB |
bfq-iosched.c | -rw-r--r-- | 255.3 KB |
bfq-iosched.h | -rw-r--r-- | 37.4 KB |
bfq-wf2q.c | -rw-r--r-- | 52.7 KB |
bio-integrity.c | -rw-r--r-- | 12.3 KB |
bio.c | -rw-r--r-- | 47.3 KB |
blk-cgroup-rwstat.c | -rw-r--r-- | 3.4 KB |
blk-cgroup-rwstat.h | -rw-r--r-- | 3.9 KB |
blk-cgroup.c | -rw-r--r-- | 49.9 KB |
blk-core.c | -rw-r--r-- | 47.2 KB |
blk-crypto-fallback.c | -rw-r--r-- | 18.5 KB |
blk-crypto-internal.h | -rw-r--r-- | 5.4 KB |
blk-crypto.c | -rw-r--r-- | 11.9 KB |
blk-exec.c | -rw-r--r-- | 3.0 KB |
blk-flush.c | -rw-r--r-- | 15.3 KB |
blk-integrity.c | -rw-r--r-- | 11.9 KB |
blk-ioc.c | -rw-r--r-- | 10.1 KB |
blk-iocost.c | -rw-r--r-- | 96.4 KB |
blk-iolatency.c | -rw-r--r-- | 28.0 KB |
blk-ioprio.c | -rw-r--r-- | 6.4 KB |
blk-ioprio.h | -rw-r--r-- | 332 bytes |
blk-lib.c | -rw-r--r-- | 11.5 KB |
blk-map.c | -rw-r--r-- | 14.1 KB |
blk-merge.c | -rw-r--r-- | 30.2 KB |
blk-mq-cpumap.c | -rw-r--r-- | 2.2 KB |
blk-mq-debugfs-zoned.c | -rw-r--r-- | 435 bytes |
blk-mq-debugfs.c | -rw-r--r-- | 24.9 KB |
blk-mq-debugfs.h | -rw-r--r-- | 2.7 KB |
blk-mq-pci.c | -rw-r--r-- | 1.3 KB |
blk-mq-rdma.c | -rw-r--r-- | 1.3 KB |
blk-mq-sched.c | -rw-r--r-- | 18.1 KB |
blk-mq-sched.h | -rw-r--r-- | 2.5 KB |
blk-mq-sysfs.c | -rw-r--r-- | 7.0 KB |
blk-mq-tag.c | -rw-r--r-- | 17.7 KB |
blk-mq-tag.h | -rw-r--r-- | 2.6 KB |
blk-mq-virtio.c | -rw-r--r-- | 1.3 KB |
blk-mq.c | -rw-r--r-- | 100.2 KB |
blk-mq.h | -rw-r--r-- | 10.1 KB |
blk-pm.c | -rw-r--r-- | 6.8 KB |
blk-pm.h | -rw-r--r-- | 763 bytes |
blk-rq-qos.c | -rw-r--r-- | 7.0 KB |
blk-rq-qos.h | -rw-r--r-- | 5.3 KB |
blk-settings.c | -rw-r--r-- | 28.4 KB |
blk-stat.c | -rw-r--r-- | 4.8 KB |
blk-stat.h | -rw-r--r-- | 4.6 KB |
blk-sysfs.c | -rw-r--r-- | 24.5 KB |
blk-throttle.c | -rw-r--r-- | 68.5 KB |
blk-timeout.c | -rw-r--r-- | 4.1 KB |
blk-wbt.c | -rw-r--r-- | 19.9 KB |
blk-wbt.h | -rw-r--r-- | 2.8 KB |
blk-zoned.c | -rw-r--r-- | 17.0 KB |
blk.h | -rw-r--r-- | 11.9 KB |
bounce.c | -rw-r--r-- | 6.7 KB |
bsg-lib.c | -rw-r--r-- | 10.0 KB |
bsg.c | -rw-r--r-- | 6.1 KB |
disk-events.c | -rw-r--r-- | 12.9 KB |
elevator.c | -rw-r--r-- | 19.0 KB |
fops.c | -rw-r--r-- | 15.2 KB |
genhd.c | -rw-r--r-- | 35.1 KB |
holder.c | -rw-r--r-- | 4.2 KB |
ioctl.c | -rw-r--r-- | 15.8 KB |
ioprio.c | -rw-r--r-- | 5.1 KB |
keyslot-manager.c | -rw-r--r-- | 16.3 KB |
kyber-iosched.c | -rw-r--r-- | 27.9 KB |
mq-deadline.c | -rw-r--r-- | 30.1 KB |
opal_proto.h | -rw-r--r-- | 9.4 KB |
sed-opal.c | -rw-r--r-- | 62.5 KB |
t10-pi.c | -rw-r--r-- | 7.7 KB |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...