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 X-Spam-Level: X-Spam-Status: No, score=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD8ACC433FE for ; Mon, 7 Dec 2020 16:42:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 70A8123877 for ; Mon, 7 Dec 2020 16:42:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727780AbgLGQmx (ORCPT ); Mon, 7 Dec 2020 11:42:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:39396 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725866AbgLGQmx (ORCPT ); Mon, 7 Dec 2020 11:42:53 -0500 Date: Mon, 7 Dec 2020 08:42:11 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607359332; bh=r39jSa7O4h4XF+mtH8ZkdKDvVNF09KuX0GRwTm1zppU=; h=From:To:Cc:Subject:References:In-Reply-To:From; b=PuveFqKDjL3pYA8tgl7/wgzAdtn5QZxJPtExTfKEto6Fl8R1rgpB37DBAbi/qGu3/ tfbR5z4EwZp/4pHzAhPLeGM3ObvwjjSds9IV5L22ACXP3641WlC32VzvZFwBLEsNW4 c8HSApyYTwiUk7v45i15/URjObZ+Lz9Zcg8n0hG5mNI9GTEavhjLAXvN95r5LlaOuc wMQw6bY7YSHsemGpq4ybnbU1L8LfGFyQ1KR7XMQOCIIOs7QjUZEXl2tbDMQejryN2+ BUBJVZ7n3IlBXSZmhiipJB3njLMmjkq5DYAcyrrPVUVwijUGHfVu4u9IPl48vAJDOl N8b1tl89Cgebw== From: Jaegeuk Kim To: Chao Yu Cc: Daeho Jeong , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com, Daeho Jeong Subject: Re: [f2fs-dev] [PATCH v3] f2fs: fix race of pending_pages in decompression Message-ID: References: <20201205042626.1113600-1-daeho43@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/07, Chao Yu wrote: > On 2020/12/7 15:28, Daeho Jeong wrote: > > > It looks like it will be better to move this into merge condition? > > > > > > if (bio && (!page_is_mergeable(sbi, bio, > > > *last_block_in_bio, blkaddr) || > > > !f2fs_crypt_mergeable_bio(bio, inode, page->index, NULL) || > > > f2fs_verify_mergeable_bio())) { > > > > > > > I tried this for the first time, but it requires unnecessary checks > > within the compression cluster. > > We only need to check f2fs_verify_mergeable_bio for i == 0 case? something like: > > static bool f2fs_verify_mergeable_bio(struct bio *bio, bool verify, bool first_page) > { > if (!first_page) Agreed that we don't need to run this instruction for every pages. > return false; > if (!verify) > return false; > > ctx = bio->bi_private; > if (!(ctx->enabled_steps & (1 << STEP_VERITY))) > return true; > } > > Thoughts? > > > I wanted to just check one time in the beginning of the cluster. > > What do you think? > > It's trivial, but I'm think about the readability... at least, one line comment > is needed to describe why we submit previous bio. :) I added like this. :P https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/?h=dev&id=f189a2471df2560e5834d999ab4ff68bc10853e4 > > Thanks, > > > . > >