Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp787283ybl; Wed, 8 Jan 2020 05:57:37 -0800 (PST) X-Google-Smtp-Source: APXvYqwnfQkZ2DimMjpfekTAoBQByORrfyw+1eZu2AaKIL1rEXvkYKux6o1yLl0qvrcp9+AkduA/ X-Received: by 2002:a9d:7519:: with SMTP id r25mr4169937otk.284.1578491857214; Wed, 08 Jan 2020 05:57:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578491857; cv=none; d=google.com; s=arc-20160816; b=xsl10GH32TYzizE9ttKFQqzcd/oBZLjpvmUiozWD//jJCHExkMZbwSkuuQxLAygKWW KXX88+NoSURy2loqj2dnnct0cylOUciQ/1wpsMCYwXkhNEHgzrNEFuueH8IcyY9/JR5/ GyigVAENEI9+Xm2vzD9r2YELIapVtRmdYge/wTxyLDSS8fJcaVp3sdUrBDiwdj9YX71M dyec2uvdIAjY3OpWEnwj2eVzKvZOLzucA9yalVcOeVRzexkWc0EEytgURdCD2HGrzhxU 6FjBpwVQqSqn8yaS4kvisBBlzo2+F67MtfZFgJJxjgEHuW1yxTLIppXYnrCu1syxIOBg RMCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=H6DMmvtSkJrGXz7FDceasztVCwwZj6CKH3COvQITZ0I=; b=MuZXCMW3XKsTnyBmbxAiRS1QaZmUMiNskEUx17Ttvx5cLg5Q1bGL57vChAV6TiWDib l7P4AlAYykku6ZO8Bov+5zR5sziy9cLasUCJ1dPvhOE5lGc3B6UVNGU8Rhc37emWOWdn Yqo4UEaeVcYJY16Omiy1CQ/guuGqouSyVLyI8z0OktAMb7eoce9LqLr3Cd9vYgNamEze GJR4b/M4ZSl+hGySBvMEbSuNq1MucEekKrQbTTUl5hMgrJI6meY518X3Bbd5et/hyoJw nsnt9drFk6Raq+XkBpu+BVAhGctQ9wDpb9LTZ2MhlyeAYbut8xgfFLiS1rHOG39wtzLa 1i8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qqe7RbJU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id m26si1700246otn.307.2020.01.08.05.57.24; Wed, 08 Jan 2020 05:57:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qqe7RbJU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727518AbgAHMEq (ORCPT + 99 others); Wed, 8 Jan 2020 07:04:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:41704 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726252AbgAHMEp (ORCPT ); Wed, 8 Jan 2020 07:04:45 -0500 Received: from localhost (c-98-234-77-170.hsd1.ca.comcast.net [98.234.77.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0270C206DA; Wed, 8 Jan 2020 12:04:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578485085; bh=8Ibxjwt6kC+hGFr1IDrRoG3a1vKrpplBnsa/l24ADGY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qqe7RbJUrhsfFDWUr1VAjV9s+B+nCgyhyRUUxC3WVvcThiR+pl5QeR+MkEMuYDolu NdYxE5lfSt6NpK3W8TY3uKgGk2GxMNbf9s7SBlfxye4Qhy9ijEnjMaXdkFxMI6EOdK gK9SGEFaHxbXxvyd0XTkOZyI8j3pFaBXLm6oCSc0= Date: Wed, 8 Jan 2020 04:04:44 -0800 From: Jaegeuk Kim To: Chao Yu Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re: [f2fs-dev] [PATCH] f2fs: add a way to turn off ipu bio cache Message-ID: <20200108120444.GC28331@jaegeuk-macbookpro.roam.corp.google.com> References: <20200107020709.73568-1-jaegeuk@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.2 (2017-04-18) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/08, Chao Yu wrote: > On 2020/1/7 10:07, Jaegeuk Kim wrote: > > Setting 0x40 in /sys/fs/f2fs/dev/ipu_policy gives a way to turn off > > bio cache, which is useufl to check whether block layer using hardware > > encryption engine merges IOs correctly. > > > > Signed-off-by: Jaegeuk Kim > > --- > > Documentation/filesystems/f2fs.txt | 1 + > > fs/f2fs/segment.c | 2 +- > > fs/f2fs/segment.h | 1 + > > 3 files changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/Documentation/filesystems/f2fs.txt b/Documentation/filesystems/f2fs.txt > > index 41b5aa94b30f..cd93bcc34726 100644 > > --- a/Documentation/filesystems/f2fs.txt > > +++ b/Documentation/filesystems/f2fs.txt > > @@ -335,6 +335,7 @@ Files in /sys/fs/f2fs/ > > 0x01: F2FS_IPU_FORCE, 0x02: F2FS_IPU_SSR, > > 0x04: F2FS_IPU_UTIL, 0x08: F2FS_IPU_SSR_UTIL, > > 0x10: F2FS_IPU_FSYNC. > > . -> , Actually, we can't do it. I revised it a bit instead. > > Reviewed-by: Chao Yu > > Thanks, > > > + 0x40: F2FS_IPU_NOCACHE disables bio caches. > > > > min_ipu_util This parameter controls the threshold to trigger > > in-place-updates. The number indicates percentage > > diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c > > index a9519532c029..311fe4937f6a 100644 > > --- a/fs/f2fs/segment.c > > +++ b/fs/f2fs/segment.c > > @@ -3289,7 +3289,7 @@ int f2fs_inplace_write_data(struct f2fs_io_info *fio) > > > > stat_inc_inplace_blocks(fio->sbi); > > > > - if (fio->bio) > > + if (fio->bio && !(SM_I(sbi)->ipu_policy & (1 << F2FS_IPU_NOCACHE))) > > err = f2fs_merge_page_bio(fio); > > else > > err = f2fs_submit_page_bio(fio); > > diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h > > index a1b3951367cd..02e620470eef 100644 > > --- a/fs/f2fs/segment.h > > +++ b/fs/f2fs/segment.h > > @@ -623,6 +623,7 @@ enum { > > F2FS_IPU_SSR_UTIL, > > F2FS_IPU_FSYNC, > > F2FS_IPU_ASYNC, > > + F2FS_IPU_NOCACHE, > > }; > > > > static inline unsigned int curseg_segno(struct f2fs_sb_info *sbi, > >