From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B298CC3DA59 for ; Tue, 16 Jul 2024 06:46:41 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=mjfFPjVN; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4WNV3N2sgqz3cZs for ; Tue, 16 Jul 2024 16:46:40 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=mjfFPjVN; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.alibaba.com (client-ip=115.124.30.118; helo=out30-118.freemail.mail.aliyun.com; envelope-from=hsiangkao@linux.alibaba.com; receiver=lists.ozlabs.org) Received: from out30-118.freemail.mail.aliyun.com (out30-118.freemail.mail.aliyun.com [115.124.30.118]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4WNV3F5HzDz2ysc for ; Tue, 16 Jul 2024 16:46:32 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1721112389; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=3VjkPs1ND3ZkbMZwPcFQ6dQO7g+M9DvU25mbr2pS8LQ=; b=mjfFPjVNYK4Wps804ia13gu8m0vSEewXLJLfJ1//Te35L+M39Kf0Yv+S95r84IFqLV3g2NbGPVuSE4UR+Gwcp5LJi4jNeMNyGyhejm4wtRMvFtZ/Kl+AK0wQyU2a5EupKFmukNQcKWED/NXKxbfKsPnZymb7WhWRjSa1kLQ/X9E= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R941e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037067110;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=10;SR=0;TI=SMTPD_---0WAgYxGS_1721112385; Received: from 30.97.48.217(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0WAgYxGS_1721112385) by smtp.aliyun-inc.com; Tue, 16 Jul 2024 14:46:26 +0800 Message-ID: Date: Tue, 16 Jul 2024 14:46:25 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] fs: fix schedule while atomic caused by gfp of erofs_allocpage To: Zhaoyang Huang References: <20240716054414.2446134-1-zhaoyang.huang@unisoc.com> From: Gao Xiang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: linux-erofs@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Linux EROFS file system List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, "zhaoyang.huang" , Yue Hu , linux-erofs@lists.ozlabs.org, steve.kang@unisoc.com Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" On 2024/7/16 14:43, Zhaoyang Huang wrote: > On Tue, Jul 16, 2024 at 2:20 PM Gao Xiang wrote: >> >> >> ... >>>> >>>> I don't see why it's an atomic context, >>>> so this patch is incorrect. >>> Sorry, I should provide more details. page_cache_ra_unbounded() will >>> call filemap_invalidate_lock_shared(mapping) to ensure the integrity >>> of page cache during readahead, which will disable preempt. >> >> Why a rwsem sleepable lock disable preemption? > emm, that's the original design of down_read() No. > >> context should be always non-atomic context, which is applied >> to all kernel filesystems. > AFAICT, filemap_fault/read have added the folios of readahead to page > cache which means the aops->readahead basically just need to map the > block to this folios and then launch the bio. The erofs is a little > bit different to others as it has to alloc_pages for decompression > when doing this. Interesting. The whole .readahead is sleepable, including submit block I/Os to storage. Nacked-by: Gao Xiang Thanks, Gao Xiang From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) (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 441761862C for ; Tue, 16 Jul 2024 06:46:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.99 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721112397; cv=none; b=PAGjUGNMcXwc7FOvA2R+yqBfEi8CEqpmqESYy4OM489DDdfgy219zHD/iGchCOShVxRAjV6mba26YjoywUcViC3RlUynnPRRyxW/HFkQwlVt3zRbuwyzcvOWj9LFrtDWHNaPWI8j8IDCMulUdYmzPsfobNh6YxJmmwwQOzGm1Jc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721112397; c=relaxed/simple; bh=cWVc6+CdvyhCJ8SbmioGD8az2nNiDojYywOeUMzt/Co=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=jUsLCJ1BJWA9sMZKzNReQ2EigaCE+NN9W7aKK+Elz3NEblRCZ8Vn5xw93eiPmHJEVfGC+8hESC/K2K1SksIiv0YmxrAzeBGlzNhnMJpGJCeKCSNVWIwtFewzwh2RIGAPKMbjkM2CbywwFCVs6qFI0HudthlV+iXwFm7rPCoU92o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=NMxtzTqe; arc=none smtp.client-ip=115.124.30.99 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="NMxtzTqe" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1721112386; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=3VjkPs1ND3ZkbMZwPcFQ6dQO7g+M9DvU25mbr2pS8LQ=; b=NMxtzTqe/hnFQCUWYVE1Wini4yyHdSb3XNyYlQvnnOmHph+aCObgHqlgmzCP1Op2lWIQYQtfLBQNL8vIv5sM2JzG2miuRRfWANrbWStRsaX4/wlrBNyg/83LTO7kK0NHHWOpNqdIWcuxvokybnssnmQaHoI8H0yZW+kX1Hy8JyQ= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R941e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037067110;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=10;SR=0;TI=SMTPD_---0WAgYxGS_1721112385; Received: from 30.97.48.217(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0WAgYxGS_1721112385) by smtp.aliyun-inc.com; Tue, 16 Jul 2024 14:46:26 +0800 Message-ID: Date: Tue, 16 Jul 2024 14:46:25 +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 Subject: Re: [PATCH] fs: fix schedule while atomic caused by gfp of erofs_allocpage To: Zhaoyang Huang Cc: "zhaoyang.huang" , Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu , Sandeep Dhavale , linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, steve.kang@unisoc.com References: <20240716054414.2446134-1-zhaoyang.huang@unisoc.com> From: Gao Xiang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2024/7/16 14:43, Zhaoyang Huang wrote: > On Tue, Jul 16, 2024 at 2:20 PM Gao Xiang wrote: >> >> >> ... >>>> >>>> I don't see why it's an atomic context, >>>> so this patch is incorrect. >>> Sorry, I should provide more details. page_cache_ra_unbounded() will >>> call filemap_invalidate_lock_shared(mapping) to ensure the integrity >>> of page cache during readahead, which will disable preempt. >> >> Why a rwsem sleepable lock disable preemption? > emm, that's the original design of down_read() No. > >> context should be always non-atomic context, which is applied >> to all kernel filesystems. > AFAICT, filemap_fault/read have added the folios of readahead to page > cache which means the aops->readahead basically just need to map the > block to this folios and then launch the bio. The erofs is a little > bit different to others as it has to alloc_pages for decompression > when doing this. Interesting. The whole .readahead is sleepable, including submit block I/Os to storage. Nacked-by: Gao Xiang Thanks, Gao Xiang