Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2526319pxu; Mon, 7 Dec 2020 08:45:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwpRgaBw6xsNzclM9LyJ0DwOGJGQK6iqXzYHRDccK1hNj3LdhaBiNCKC/xZK8xdA9c3BPwW X-Received: by 2002:a17:906:3a55:: with SMTP id a21mr19862597ejf.516.1607359509862; Mon, 07 Dec 2020 08:45:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607359509; cv=none; d=google.com; s=arc-20160816; b=vM4Mauvz6IzG2tpZvaQWB2YLFcBDwaB6EYW6OMr3f4RkO7K/VkIJsL4R+jrwd42DKR T8cykrsgl2OR0A3PdRM8Y9wFVfnaO8NacXJKDVdJyHZGvDZbheSrtx0Dao/g6/esuDX5 2uoMRdGX+KcSM4fWTp4cBW/ZAInKJ+RVALalKFb2WVUfThRPxexrm5WdsGGGOdPuCVm2 sak80lqMTFrSd+AFJGLSp4ExYTuLy3dsNHzT4jKxhPrQ3ZFvBITlJzFMUPA7kA9B0gUS /K6qeZhUlU+bAA8i9qHvqYAk5TXxa6Crr6O9UcGWShdxLSHbGi+iO1ArP96aFvZxDHXi x7ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=RDlSlUHv6RFTAHhfZdr3V3n70kGEWD5iUxt8Bi5X3Ww=; b=P/dXfSOY5Nqn8TuunmHwZ+IZc2yYIJcj+78urwNsNPWlMPtrbOn6ADpKrWZ7ML3jLN 1Wn6Xi2QAlvN4DvfKyXB5bT77d0KSW1ftAlJ9nbCCnvJGPm+IOTJ21zpcHzfFb7J1PQs 6Ext0bFJW6oqTzoeizT7z+NP45WmO1nfgWJAvasmNM3jQbQ5WzOMxdM2hdo0S37igPLL VyBc0EyGxwgdS1kjznpeitaiDcFjbq5nxyDH9ev42SlfJRgK5F+NOQfle3C/D1SF15a3 9ZoJdkEkcfFTzMEtP+glDBU86rhmq8W5nHbmg1CaJCST+FTW0tNy4YrRuksh3NbD9BPR mRIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PuveFqKD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bt28si1776294edb.269.2020.12.07.08.44.45; Mon, 07 Dec 2020 08:45:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PuveFqKD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727134AbgLGQmx (ORCPT + 99 others); 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, > > > . > >