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 3B48CEB64D9 for ; Mon, 10 Jul 2023 10:41:30 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4R00t04K4nz3bnB for ; Mon, 10 Jul 2023 20:41:28 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.alibaba.com (client-ip=115.124.30.100; helo=out30-100.freemail.mail.aliyun.com; envelope-from=hsiangkao@linux.alibaba.com; receiver=lists.ozlabs.org) Received: from out30-100.freemail.mail.aliyun.com (out30-100.freemail.mail.aliyun.com [115.124.30.100]) (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 4R00sw43Krz30gr for ; Mon, 10 Jul 2023 20:41:23 +1000 (AEST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R341e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046059;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0Vn1xngT_1688985677; Received: from 30.97.48.247(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0Vn1xngT_1688985677) by smtp.aliyun-inc.com; Mon, 10 Jul 2023 18:41:18 +0800 Message-ID: Date: Mon, 10 Jul 2023 18:41:17 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH] erofs: avoid unnecessary loops in z_erofs_pcluster_readmore() when read page beyond EOF To: Chunhai Guo , xiang@kernel.org, chao@kernel.org References: <20230710042531.28761-1-guochunhai@vivo.com> From: Gao Xiang In-Reply-To: <20230710042531.28761-1-guochunhai@vivo.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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: huyue2@coolpad.com, linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" On 2023/7/10 12:25, Chunhai Guo wrote: > z_erofs_pcluster_readmore() may take a long time to loop when the page > offset is large enough, which is unnecessary should be prevented. > For example, when the following case is encountered, it will loop 4691368 > times, taking about 27 seconds. > - offset = 19217289215 > - inode_size = 1442672 > > Signed-off-by: Chunhai Guo I will update the subject manually to: "erofs: avoid useless loops in z_erofs_pcluster_readmore() when reading beyond EOF" to avoid overly long subject as well... Thanks, Gao Xiang 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEDE1EB64D9 for ; Mon, 10 Jul 2023 10:41:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232922AbjGJKli (ORCPT ); Mon, 10 Jul 2023 06:41:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233497AbjGJKlZ (ORCPT ); Mon, 10 Jul 2023 06:41:25 -0400 Received: from out30-112.freemail.mail.aliyun.com (out30-112.freemail.mail.aliyun.com [115.124.30.112]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60761FF for ; Mon, 10 Jul 2023 03:41:22 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R341e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046059;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0Vn1xngT_1688985677; Received: from 30.97.48.247(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0Vn1xngT_1688985677) by smtp.aliyun-inc.com; Mon, 10 Jul 2023 18:41:18 +0800 Message-ID: Date: Mon, 10 Jul 2023 18:41:17 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH] erofs: avoid unnecessary loops in z_erofs_pcluster_readmore() when read page beyond EOF To: Chunhai Guo , xiang@kernel.org, chao@kernel.org Cc: huyue2@coolpad.com, jefflexu@linux.alibaba.com, linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <20230710042531.28761-1-guochunhai@vivo.com> From: Gao Xiang In-Reply-To: <20230710042531.28761-1-guochunhai@vivo.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/7/10 12:25, Chunhai Guo wrote: > z_erofs_pcluster_readmore() may take a long time to loop when the page > offset is large enough, which is unnecessary should be prevented. > For example, when the following case is encountered, it will loop 4691368 > times, taking about 27 seconds. > - offset = 19217289215 > - inode_size = 1442672 > > Signed-off-by: Chunhai Guo I will update the subject manually to: "erofs: avoid useless loops in z_erofs_pcluster_readmore() when reading beyond EOF" to avoid overly long subject as well... Thanks, Gao Xiang