Go to file
Tao Liu 7f4f48165c Fix a data race in multi-threading mode (--num-threads=N)
Upstream: https://github.com/makedumpfile/makedumpfile.git
Conflict: none
Resolves: RHEL-88006
Resolves: RHEL-93694

commit 65bf4c9ef0fd0cbf2fb99b60e15b00d984b391b8
Author: Tao Liu <ltao@redhat.com>
Date:   Wed Jun 25 14:23:44 2025 +1200

    [PATCH v2] Fix a data race in multi-threading mode (--num-threads=N)

    A vmcore corrupt issue has been noticed in powerpc arch [1]. It can be
    reproduced with upstream makedumpfile.

    When analyzing the corrupt vmcore using crash, the following error
    message will output:

        crash: compressed kdump: uncompress failed: 0
        crash: read error: kernel virtual address: c0001e2d2fe48000  type:
        "hardirq thread_union"
        crash: cannot read hardirq_ctx[930] at c0001e2d2fe48000
        crash: compressed kdump: uncompress failed: 0

    If the vmcore is generated without num-threads option, then no such
    errors are noticed.

    With --num-threads=N enabled, there will be N sub-threads created. All
    sub-threads are producers which responsible for mm page processing, e.g.
    compression. The main thread is the consumer which responsible for
    writing the compressed data into file. page_flag_buf->ready is used to
    sync main and sub-threads. When a sub-thread finishes page processing,
    it will set ready flag to be FLAG_READY. In the meantime, main thread
    looply check all threads of the ready flags, and break the loop when
    find FLAG_READY.

    page_flag_buf->ready is read/write by main/sub-threads simultaneously,
    but it is unprotected and unsafe. I have tested both mutex and atomic_rw
    can fix this issue. This patch takes atomic_rw for its simplicity.

    [1]: https://github.com/makedumpfile/makedumpfile/issues/15

    Resolves: https://github.com/makedumpfile/makedumpfile/issues/15
    Tested-by: Sourabh Jain <sourabhjain@linux.ibm.com>
    Signed-off-by: Tao Liu <ltao@redhat.com>

Signed-off-by: Tao Liu <ltao@redhat.com>
2025-07-17 10:31:37 +12:00
.gitignore Release makedumpfile-1.7.7-1 2025-04-24 15:36:26 +08:00
0001-PATCH-v2-Fix-a-data-race-in-multi-threading-mode-num.patch Fix a data race in multi-threading mode (--num-threads=N) 2025-07-17 10:31:37 +12:00
gating.yaml Enable gating test 2024-07-12 10:30:11 +08:00
makedumpfile.spec Fix a data race in multi-threading mode (--num-threads=N) 2025-07-17 10:31:37 +12:00
README.md Initial import for CentOS Stream 10 2024-07-10 09:36:57 +08:00
sources Release makedumpfile-1.7.7-1 2025-04-24 15:36:26 +08:00

makedumpfile

The makedumpfile package