Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp22097810ybl; Mon, 6 Jan 2020 18:09:11 -0800 (PST) X-Google-Smtp-Source: APXvYqwM41XuwmfyYNg036WEn4K0+NtPA4vaunRvenuf9ksyahwknXPna5GkCPgRE09Y2zbiQtkK X-Received: by 2002:a05:6830:1385:: with SMTP id d5mr90474518otq.61.1578362951303; Mon, 06 Jan 2020 18:09:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578362951; cv=none; d=google.com; s=arc-20160816; b=W+PTN4LkJRZ3fen46/sR1SHHXT6IomWDJTBEfAgxEIJYY4lq3OhiRsNouRxHJU6pRg rzH5A+FS1BNCfbU1qMps/ay+nMDDwqmrRfJVYn6mMS8apzPsDQ68yTKN+7Bfa1JKwT7x DCkPF9AxTPhlshfROeArDzmx+YGdtH3dG5eQKo54Vp9sBtktRj1LMMQlxIIEdBDgm5jA 5MMFLxtrKQXnfDy6aYuR4TMl0BrL6b6UM6M0rcveCCiPWLaVvDdhKqWDev9Eoxnm5pOt JAghEHi3D9eYTLvjHtGSloFRHXzqeXiU/oe5tLY9aQs4oirHA1Dvy340zD7DtAKpmQpx 985A== 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:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=kIsuTAx47TH5fb7e4+0knAfYnPHfrTRVbW372x8XTHU=; b=OsD3fBlaguyg4lSDqavEqdjXhjk90+6kMZkiBSdF3m3jC7Zeeaj8jtPrNotwk+hR95 nNWqnMAdOHUjjwtwLNwvr6Q+1m+rDbQ38OYF+8L1chWxxlonYsYZxnLJ2gIR/yaakpJl ZY06acCJU9vtHLMQFRd0WxGYQA9pxfXy4zwbVElm2jQLwRM3NY5MscEJz48lIZPMKLmB CZCr+7OP8jeEm9LHGEqiZraKoncXGhc+8JjILcua82aHeVQ7CZgrU3FNQvBfMlG/e1U6 et97JttL6OX/XqBK/iZeYMg7x/du+Hdmm/1vj0BVqbxPuVflcJ/IOvFnVol6CEKfjOHG jSyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vezTOWd0; 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 f203si33410195oib.56.2020.01.06.18.08.59; Mon, 06 Jan 2020 18:09:11 -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=vezTOWd0; 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 S1727465AbgAGCHM (ORCPT + 99 others); Mon, 6 Jan 2020 21:07:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:36770 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727250AbgAGCHL (ORCPT ); Mon, 6 Jan 2020 21:07:11 -0500 Received: from localhost (unknown [104.132.0.81]) (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 3698220715; Tue, 7 Jan 2020 02:07:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578362831; bh=YcE7t3XTXnWAd1OgFRbOFUYls33MgydieLk49V9wlMo=; h=From:To:Cc:Subject:Date:From; b=vezTOWd0ixvoWWuFn6wO4gzSDKGJRXQvt1n2BqRAjS8PVfRmy0K8SnTvPzk9CaTXw xQza6b7eSgZWexdMy5yb6m1KH7ZsjPIN6ljLDCOcDSjIzMuxtJWXNew12Bh3xusjbO fooTSb3l4VsR17zcbyftv/q16FxjU+TEDedPzOjY= From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH] f2fs: add a way to turn off ipu bio cache Date: Mon, 6 Jan 2020 18:07:09 -0800 Message-Id: <20200107020709.73568-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.24.0.525.g8f36a354ae-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. + 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, -- 2.24.0.525.g8f36a354ae-goog