Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5338928rwd; Tue, 23 May 2023 23:40:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ63oJTjDsUQoQA8DTUr+mKOHFe4dDM54wR8+do0mjONBwQcVe+fUGq/+qxs0Y3u1Izl/uQ8 X-Received: by 2002:a05:6a20:728a:b0:10b:9527:7127 with SMTP id o10-20020a056a20728a00b0010b95277127mr9666063pzk.20.1684910413672; Tue, 23 May 2023 23:40:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684910413; cv=none; d=google.com; s=arc-20160816; b=hgwn9N4S+7x/ltv4Bf7wOagQ78bIL7RbV/nGXjICdulOAKl35as9Ix0MnlgCyzGM0f JYn0k64OVPUTCN5pBKJfT8fgCZSCo79oh/jIzuz6L5Q7YkgDMNXSAs2ia7aiEW5lQxqg x+lWMZgCpahNBNm2bd2LL+ij1qkI2cxtLXN4eONHc+KQcJFGVB8R2+05TOdpm+Skrcv0 0Hw0bluJO3BIHSqHzMt0OzSkx+fzwrpI4RgelJUbqNuN8Hm/BizjxP8tSFfc62I98nOD e6css3jR+xPq2plRgzedYB/3aupWaFwC0CqHRTS5HiNhIT90dw5tKss4zymtYk5Boprv 9pYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=4x6wBTkKCnWAkFW8+Q30uA0WU463d8S0vZl2HT8yTvA=; b=Zkg59tXnXzVPUYykK7lZmvg8lEvs4NoXdrEWjgUeC1Wu6MP9PZSNEAQKq/OErLoiJM NxFJiZtDcKujuDvYdVpZnAN3IvE4K8wVH+NaK67N7AboHmsKa5vfo/TU8+6wXauZ3cOQ cAU6b7nZeWm4FdyPSbyoj2jSPeK+QS2nCycV4mN5PtLOkLtBit71u2y1GEQAMivD9QR5 wWXsZVB49XeKDvLQY3x1TaHtTCB4lnUl3NiQkpMHTLN+RagMk+8u+2bk4CtVimRRFztk faOfrRznM1BeJSUmoAPH/oYkRnENAQgjsv1cvhi+dEM2id+DlQ5huRNXxSWTpwos3smN zUVA== 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 pm8-20020a17090b3c4800b0024e1ae3fb36si779387pjb.128.2023.05.23.23.40.00; Tue, 23 May 2023 23:40:13 -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 S239272AbjEXGSO (ORCPT + 99 others); Wed, 24 May 2023 02:18:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236497AbjEXGSK (ORCPT ); Wed, 24 May 2023 02:18:10 -0400 Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A1BE1BC for ; Tue, 23 May 2023 23:17:41 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;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=8;SR=0;TI=SMTPD_---0VjMtVRI_1684909055; Received: from 30.97.48.247(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0VjMtVRI_1684909055) by smtp.aliyun-inc.com; Wed, 24 May 2023 14:17:36 +0800 Message-ID: <058b354f-3543-bf60-4a1c-8e4bcefcd49a@linux.alibaba.com> Date: Wed, 24 May 2023 14:17:34 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH] erofs: remove the member readahead from struct z_erofs_decompress_frontend To: Yue Hu , xiang@kernel.org, chao@kernel.org, jefflexu@linux.alibaba.com, linux-erofs@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, huyue2@coolpad.com, zhangwen@coolpad.com References: <20230524061152.30155-1-zbestahu@gmail.com> From: Gao Xiang In-Reply-To: <20230524061152.30155-1-zbestahu@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,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 2023/5/24 23:11, Yue Hu wrote: > From: Yue Hu > > The struct member is only used to add REQ_RAHEAD during I/O submission. > So it is cleaner to pass it as a parameter than keep it in the struct. > > Also, rename function z_erofs_get_sync_decompress_policy() to > z_erofs_is_sync_decompress() for better clarity and conciseness. > > Signed-off-by: Yue Hu > --- > fs/erofs/zdata.c | 19 +++++++++---------- > 1 file changed, 9 insertions(+), 10 deletions(-) > > diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c > index 45f21db2303a..4522a3be2ce9 100644 > --- a/fs/erofs/zdata.c > +++ b/fs/erofs/zdata.c > @@ -550,7 +550,6 @@ struct z_erofs_decompress_frontend { > z_erofs_next_pcluster_t owned_head; > enum z_erofs_pclustermode mode; > > - bool readahead; > /* used for applying cache strategy on the fly */ > bool backmost; > erofs_off_t headoffset; > @@ -1106,7 +1105,7 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe, > return err; > } > > -static bool z_erofs_get_sync_decompress_policy(struct erofs_sb_info *sbi, > +static bool z_erofs_is_sync_decompress(struct erofs_sb_info *sbi, > unsigned int readahead_pages) > { > /* auto: enable for read_folio, disable for readahead */ > @@ -1672,7 +1671,7 @@ static void z_erofs_decompressqueue_endio(struct bio *bio) > static void z_erofs_submit_queue(struct z_erofs_decompress_frontend *f, > struct page **pagepool, > struct z_erofs_decompressqueue *fgq, > - bool *force_fg) > + bool *force_fg, bool readahead) > { > struct super_block *sb = f->inode->i_sb; > struct address_space *mc = MNGD_MAPPING(EROFS_SB(sb)); > @@ -1763,7 +1762,7 @@ static void z_erofs_submit_queue(struct z_erofs_decompress_frontend *f, > bio->bi_iter.bi_sector = (sector_t)cur << > (sb->s_blocksize_bits - 9); > bio->bi_private = q[JQ_SUBMIT]; > - if (f->readahead) > + if (readahead) > bio->bi_opf |= REQ_RAHEAD; > ++nr_bios; > } > @@ -1799,13 +1798,14 @@ static void z_erofs_submit_queue(struct z_erofs_decompress_frontend *f, > } > > static void z_erofs_runqueue(struct z_erofs_decompress_frontend *f, > - struct page **pagepool, bool force_fg) > + struct page **pagepool, bool force_fg, > + bool readahead) struct page **pagepool, bool force_fg, bool ra) > { > struct z_erofs_decompressqueue io[NR_JOBQUEUES]; > > if (f->owned_head == Z_EROFS_PCLUSTER_TAIL) > return; > - z_erofs_submit_queue(f, pagepool, io, &force_fg); > + z_erofs_submit_queue(f, pagepool, io, &force_fg, readahead); z_erofs_submit_queue(f, pagepool, io, &force_fg, ra); Otherwise it seems ok to me, Reviewed-by: Gao Xiang Thanks, Gao Xiang