Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp694741ybl; Wed, 8 Jan 2020 04:24:22 -0800 (PST) X-Google-Smtp-Source: APXvYqzKAhnNUr34jnIC2CAgUsqrBF++cXFsDmhxff0Wg+VasLcfZV2soxXb9lMuUgRztUMTtp87 X-Received: by 2002:a05:6808:a11:: with SMTP id n17mr2717174oij.94.1578486261883; Wed, 08 Jan 2020 04:24:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578486261; cv=none; d=google.com; s=arc-20160816; b=CbwmQSSPpDFXZr1NkPZoX5n1znc28pHMe6UJyXhNONsOdt00pH3RxoBz+BDTLFYO6i pND3b/iWhhPcMgKFRbDy48ZlH2XH2BEd7myTclYxVYFyvejLCWeIDF8WnvYbGqSgCW0z xnng3E7toBtxGYOp6VdvfoLlGvReO83qshrZSfVWa9l8UwDWtUi6QDIK3rbRfAX7aRVz 1fwXn6eP5HY8hv6I7uqaP5YKAtyutg+cpTsLYKUEyyls5g+n0XxXY8kTGcnBeo8gJg7Q lf3/kCGDkFHjnbNPc26Pac2lkY3xddeMHeepGRqm126SQ/J3G1l1I3+zm/AC/DTZ5xE8 1KgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=quNR/USGEIftgrh40muf5fRBPfbh8ysyI9GIbM3qsKU=; b=zXbH/tnHHQfiK+MSZvkpm+qnGpBWH7TJHh6U0AD0mqoHA1buyaLTLetpBPfI1EZ8ed q8qveAod8CnZUX0KlFZPdhtO3Ucvb8U2YsnnvPKr9CJcFprchQzXQ+MS6YQHkUNXq8ZQ nf2s58uTiuuO3Pt1ZLOWpFldKPoF779r01opQO9anvfBiGHIhCaXRFQjPwtSp6DsqEl2 72Y07MUVR55OJzSqM03LxudefvR3fKKsdV2xfiNTqpdhQX1hXbZ+iIXDuCXRPjLAy/3t KEwcMLNktyIhkt4qplGyTzdjpL3EI4xQKwF0cgPYLbfxE+F6fzKZQ564W2oJ02UNwe2T B2yA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v145si1682885oia.68.2020.01.08.04.24.10; Wed, 08 Jan 2020 04:24:21 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727809AbgAHMXU (ORCPT + 99 others); Wed, 8 Jan 2020 07:23:20 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:35438 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726967AbgAHMXT (ORCPT ); Wed, 8 Jan 2020 07:23:19 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 1C490AC9D5E052C803CA; Wed, 8 Jan 2020 20:23:18 +0800 (CST) Received: from [10.134.22.195] (10.134.22.195) by smtp.huawei.com (10.3.19.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 8 Jan 2020 20:23:16 +0800 Subject: Re: [f2fs-dev] [PATCH] f2fs: add a way to turn off ipu bio cache To: Jaegeuk Kim CC: , References: <20200107020709.73568-1-jaegeuk@kernel.org> <20200108120444.GC28331@jaegeuk-macbookpro.roam.corp.google.com> From: Chao Yu Message-ID: Date: Wed, 8 Jan 2020 20:23:15 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200108120444.GC28331@jaegeuk-macbookpro.roam.corp.google.com> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/1/8 20:04, Jaegeuk Kim wrote: > 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. One more question, why skipping 0x20 bit position? Thanks, > >> >> 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, >>> > . >