public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yue Hu <zbestahu@gmail.com>
To: Yuwen Chen <chenyuwen1@meizu.com>
Cc: <xiang@kernel.org>,
	linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] erofs: Wake up all waiters after z_erofs_lzma_head ready.
Date: Mon, 27 Jun 2022 13:57:54 +0800	[thread overview]
Message-ID: <20220627135754.00000999.zbestahu@gmail.com> (raw)
In-Reply-To: <20220625145000.2720-1-chenyuwen1@meizu.com>

On Sat, 25 Jun 2022 22:50:00 +0800
Yuwen Chen <chenyuwen1@meizu.com> wrote:

> When the user mounts the erofs second times, the decompression thread
> may hung. The problem happens due to a sequence of steps like the
> following:
> 
> 1) Task A called z_erofs_load_lzma_config which obtain all of the node
>    from the z_erofs_lzma_head.
> 
> 2) At this time, task B called the z_erofs_lzma_decompress and wanted to
>    get a node. But the z_erofs_lzma_head was empty, the Task B had to
>    sleep.
> 
> 3) Task A release nodes and push nodes into the z_erofs_lzma_head. But
>    task B was still sleeping.
> 
> One example report when the hung happens:
> task:kworker/u3:1 state:D stack:14384 pid: 86 ppid: 2 flags:0x00004000
> Workqueue: erofs_unzipd z_erofs_decompressqueue_work
> Call Trace:
>  <TASK>
>  __schedule+0x281/0x760
>  schedule+0x49/0xb0
>  z_erofs_lzma_decompress+0x4bc/0x580
>  ? cpu_core_flags+0x10/0x10
>  z_erofs_decompress_pcluster+0x49b/0xba0
>  ? __update_load_avg_se+0x2b0/0x330
>  ? __update_load_avg_se+0x2b0/0x330
>  ? update_load_avg+0x5f/0x690
>  ? update_load_avg+0x5f/0x690
>  ? set_next_entity+0xbd/0x110
>  ? _raw_spin_unlock+0xd/0x20
>  z_erofs_decompress_queue.isra.0+0x2e/0x50
>  z_erofs_decompressqueue_work+0x30/0x60
>  process_one_work+0x1d3/0x3a0
>  worker_thread+0x45/0x3a0
>  ? process_one_work+0x3a0/0x3a0
>  kthread+0xe2/0x110
>  ? kthread_complete_and_exit+0x20/0x20
>  ret_from_fork+0x22/0x30
>  </TASK>
> 
> Signed-off-by: Yuwen Chen <chenyuwen1@meizu.com>
> ---
>  fs/erofs/decompressor_lzma.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/erofs/decompressor_lzma.c b/fs/erofs/decompressor_lzma.c
> index 05a3063cf2bc..5e59b3f523eb 100644
> --- a/fs/erofs/decompressor_lzma.c
> +++ b/fs/erofs/decompressor_lzma.c
> @@ -143,6 +143,7 @@ int z_erofs_load_lzma_config(struct super_block *sb,
>  	DBG_BUGON(z_erofs_lzma_head);
>  	z_erofs_lzma_head = head;
>  	spin_unlock(&z_erofs_lzma_lock);
> +	wake_up_all(&z_erofs_lzma_wq);
>  
>  	z_erofs_lzma_max_dictsize = dict_size;
>  	mutex_unlock(&lzma_resize_mutex);

Please do not end the summary line(title) with a period.

  parent reply	other threads:[~2022-06-27  5:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-25 14:50 [PATCH] erofs: Wake up all waiters after z_erofs_lzma_head ready Yuwen Chen
2022-06-27  2:56 ` Gao Xiang
2022-06-27  5:57 ` Yue Hu [this message]
2022-06-27  6:15   ` Gao Xiang
2022-06-26 22:40     ` [PATCH] erofs: wake " Yuwen Chen
2022-06-27  7:11       ` Yuwen Chen
  -- strict thread matches above, loose matches on Subject: below --
2022-06-25 13:18 [PATCH] erofs: Wake " Even
2022-06-25  8:57 Even
2022-06-25  9:44 ` Gao Xiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220627135754.00000999.zbestahu@gmail.com \
    --to=zbestahu@gmail.com \
    --cc=chenyuwen1@meizu.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xiang@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox