From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E47D364026 for ; Wed, 18 Mar 2026 06:07:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773814049; cv=none; b=h8sDsMlYFHECg/Zb7tTaF1GlVP0QfUnJVTay9JQkB9OV572CdTO8f5Ht/4123W7pPH+P0gbTx/eZtQXLVLvgLRjIsq5vRP09EtuniIBQghZjX03i+I0vofI7Ol1EpkjrIWCSotiUNUA1zuBZy9uBeRHFmhc9WcuWp1as7D+4F1Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773814049; c=relaxed/simple; bh=yP5/iQJCNcG6ji06jAFAHa49tFVPh+/YzwK+WAC0kSg=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=Pq5Rqx/WguAD4NYK8QLAt2caRXvdqa5tkCbfaIT0iTYuWiq77LvI46ifPQMSfgoi+EvZufhzCG2p8fQ0/UiSW9VojSMh9qMNohbFOAfPQfHaxnlQNfTTAAGgxQDCApD2CgfZBSy5POiIbxFjpcQishb+TFBevbhPSJylQRC6zrI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=F6McLun8; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="F6McLun8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C03FC19421; Wed, 18 Mar 2026 06:07:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773814048; bh=yP5/iQJCNcG6ji06jAFAHa49tFVPh+/YzwK+WAC0kSg=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=F6McLun887k2J+kOsvXUUIrKgJoD8v5E54/s0h88YkYuINDVE8c69qjlQSSU5/RAP EscQ5NHtlGYk/FbRpzQbd2Mm0axcS4UbL7UkSVz+jNx1NKgfQ7rqNw7MxLi78yyvbk +/MDRTIrYpD98qMOfAey/DrTKXD7bRjXzy25rMMTQgjGQXToKKq5TU7BMG7/EYPQZv zE5geOvs/oKeaE4pDkFbww7yhfXv9YyVVBcyJYoYOPQxy7AxuTj1e6FCOhAzlIrgmV O458+M89lEesi+ixpOUngaCcc929xGNctXmQd8aO3jOeZWeHl8GIl5mvL8WXLthGSK X2YZnrfMja2Pw== Message-ID: <4acad3d6-ce48-4191-970a-95bcbe8edb01@kernel.org> Date: Wed, 18 Mar 2026 14:07:21 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: chao@kernel.org, linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, jianxin.pan@amlogic.com, tuan.zhang@amlogic.com Subject: Re: [PATCH v2] erofs: add GFP_NOIO in the bio completion if needed To: jiucheng.xu@amlogic.com, Gao Xiang , Yue Hu , Jeffle Xu , Sandeep Dhavale , Hongbo Li , Chunhai Guo References: <20260311-origin-dev-v2-1-0657cff690eb@amlogic.com> Content-Language: en-US From: Chao Yu In-Reply-To: <20260311-origin-dev-v2-1-0657cff690eb@amlogic.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2026/3/11 17:11, Jiucheng Xu via B4 Relay wrote: > From: Jiucheng Xu > > The bio completion path in the process context (e.g. dm-verity) > will directly call into decompression rather than trigger another > workqueue context for minimal scheduling latencies, which can > then call vm_map_ram() with GFP_KERNEL. > > Due to insufficient memory, vm_map_ram() may generate memory > swapping I/O, which can cause submit_bio_wait to deadlock > in some scenarios. > > Trimmed down the call stack, as follows: > > f2fs_submit_read_io > submit_bio //bio_list is initialized. > mmc_blk_mq_recovery > z_erofs_endio > vm_map_ram > __pte_alloc_kernel > __alloc_pages_direct_reclaim > shrink_folio_list > __swap_writepage > submit_bio_wait //bio_list is non-NULL, hang!!! > > Use memalloc_noio_{save,restore}() to wrap up this path. > > Reviewed-by: Gao Xiang > Signed-off-by: Jiucheng Xu Reviewed-by: Chao Yu Thanks,