Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2572287iog; Sun, 26 Jun 2022 20:34:52 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tWifWNUaQ35rVO9CCtNLxegMFp+TUfOW+6WUFo7JtftIlvLnyF3nVZKsKj10PhPlUNTz26 X-Received: by 2002:a05:6a00:16c7:b0:520:6ede:2539 with SMTP id l7-20020a056a0016c700b005206ede2539mr12548706pfc.46.1656300892590; Sun, 26 Jun 2022 20:34:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656300892; cv=none; d=google.com; s=arc-20160816; b=p5ehkY/j15yEAEHUIwpjz0maY8s28sfUG7G0C0wYC4Gw4a1jlpU6QnPWqug+UqH2Tz nNN6xrZIsjlsBz+lK7D7iJWoV3rTxt3GbT1wq/RFYRSI5R1uYawxB1fguTW8+36J7t/Z 0/L6eEiG9fPZbDovb6bFhDtefWfIJ07/666BSWZyA4a5T6EcyUKYDiqA257GVndSP4mI A2V7+crjkUasyHv+xn4Sg4EfXj02jafShKh/Q8xRd/Dr89chvCb8Xh4fsEHYf2tjiY33 laF05hI20QStAyVtDF0JVj9vPJSBk51Pb6ty6Ux6TXM9v8/qBZOFrfqV4WkOk9bdzL1K QLGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Hp11eLWk1Hh4kPkTUdipXweUKb9RMkZjUwVrldPN1PA=; b=Cvb6Te89xk1po8G4RdaFmQ4fnLLZOvetDNVmh3/ryAL2+3bCJpj7kKmuvNz6vW7+Ho xYW39ZxCxsZeRJcRVPhyYrsGuD83bSfxl0PZ4iaC8YjMIRA0xGi3jIc/4NEwTmUq+leG 57YZOw8VwkNWu2NyMj/QRw7fT5GSG7O40SG2IjYUv6dkSCQUN+tGS25Lp2PrxsRJiTE2 j5+JC6EpLeQwPHMXyENkicM7UO3LlShzKk2LwK2LRm3/gZoE15RnOCYnviwbpDur1i4C gZ2wOjET2w5ld6o5JqzG0LA4drBd0W42ZK1DvFhRCxG8gzH56GWuInGlw+Q7HZHgpwmE oeGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p6-20020a63f446000000b0040d5ab9d8d1si12697289pgk.469.2022.06.26.20.34.38; Sun, 26 Jun 2022 20:34:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232220AbiF0C4a (ORCPT + 99 others); Sun, 26 Jun 2022 22:56:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232077AbiF0C4P (ORCPT ); Sun, 26 Jun 2022 22:56:15 -0400 Received: from out30-56.freemail.mail.aliyun.com (out30-56.freemail.mail.aliyun.com [115.124.30.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F80838AD for ; Sun, 26 Jun 2022 19:56:12 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R201e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04400;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0VHRLgaG_1656298568; Received: from B-P7TQMD6M-0146.local(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0VHRLgaG_1656298568) by smtp.aliyun-inc.com; Mon, 27 Jun 2022 10:56:10 +0800 Date: Mon, 27 Jun 2022 10:56:08 +0800 From: Gao Xiang To: Yuwen Chen Cc: xiang@kernel.org, chao@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. Message-ID: References: <20220625145000.2720-1-chenyuwen1@meizu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220625145000.2720-1-chenyuwen1@meizu.com> X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 25, 2022 at 10:50:00PM +0800, Yuwen Chen 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: > > __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 > > > Signed-off-by: Yuwen Chen Reviewed-by: Gao Xiang Thanks, Gao Xiang