Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp689029ybh; Tue, 10 Mar 2020 06:31:11 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuWP7C86uTUS2MHr2jBU7OCPZU7cEa9wtakJEpnCvq5gYfa73LDT8oAXKpri7hP09o07ewE X-Received: by 2002:aca:4bc5:: with SMTP id y188mr1159522oia.9.1583847071245; Tue, 10 Mar 2020 06:31:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583847071; cv=none; d=google.com; s=arc-20160816; b=1KiRKhTQ5uqNioAg8O1n1zw7IIYI3rMybYgNlgYLEt1Cc/0vpImCRqCqy29HsJHWub HKLFcZYVZiJvE1MVtDUQFsbFTuRt3NQkuvtWNCPwT47geoOOBRJAq2bfQ7qd/8vEKVmT bV0ituUReQeF3A48wdXHx9BHKVj7yYF8gt8Vt3BC0OFg84huEY3DKhuuk8W9N0wde617 U4n13jv90fOOL/P4GOchKJmf2iYvHj6dEBFmlHWA5kRgTMgmC7flN28raSsz2dn1hTEk T3IK0E6wJ4pGMd5//dnciaQ63sIeVI6w/TYQNxVDQh+4H4QbA1mJDSvANepYxXsyq2Lw rfnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=+dk68FRn+nIsT6PsnjgyGamjsTSfiSfc30LYaPSxrD8=; b=GHqoMukSFEgRQJFp5gxYVJvy9QFSHWCXIQ5QcWpv5WhO0fW5mXaa/r/N9BHrbLZS7u C3LzAIfHZnbodGv9HCvwbnkXhHlt3gmGHu7vVa0Ah+t+L+oc8UToUaKzFY6CxfH6B9Xa XjQb8O5ZqnGqUHx4fHPJ6pLmF79Fwed2vo7GCJ2I06fKGzoFhZoEkhmU3uu9ziIKkVFN +LS/tKH/S+gAsujUCgY1llzpS9Si4pnyUZGg3gnxbPI1foV6SriuX09r0da5m6iLawjl jMiAVSlgj067HwjBtH1o4JZ1FfPgGJRrPw1dKM+0jjOp8HIcGviB4BF0e8NcDyemlkaL Ym3g== 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 v1si1205653otj.204.2020.03.10.06.30.59; Tue, 10 Mar 2020 06:31:11 -0700 (PDT) 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 S1728129AbgCJMud (ORCPT + 99 others); Tue, 10 Mar 2020 08:50:33 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:11616 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728596AbgCJMu3 (ORCPT ); Tue, 10 Mar 2020 08:50:29 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 7B8B0322FAE80E6DD4EA; Tue, 10 Mar 2020 20:50:21 +0800 (CST) Received: from szvp000203569.huawei.com (10.120.216.130) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Tue, 10 Mar 2020 20:50:12 +0800 From: Chao Yu To: CC: , , , Chao Yu Subject: [PATCH 2/5] f2fs: force compressed data into warm area Date: Tue, 10 Mar 2020 20:50:06 +0800 Message-ID: <20200310125009.12966-2-yuchao0@huawei.com> X-Mailer: git-send-email 2.18.0.rc1 In-Reply-To: <20200310125009.12966-1-yuchao0@huawei.com> References: <20200310125009.12966-1-yuchao0@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.120.216.130] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Generally, data shows better continuity in warm data area as its default allocation direction is right, in order to enhance sequential read/write performance of compress inode, let's force compress data into warm area. Signed-off-by: Chao Yu --- fs/f2fs/segment.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 601d67e72c50..ab1bc750712a 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -3037,9 +3037,10 @@ static int __get_segment_type_6(struct f2fs_io_info *fio) if (fio->type == DATA) { struct inode *inode = fio->page->mapping->host; - if (is_cold_data(fio->page) || file_is_cold(inode) || - f2fs_compressed_file(inode)) + if (is_cold_data(fio->page) || file_is_cold(inode)) return CURSEG_COLD_DATA; + if (f2fs_compressed_file(inode)) + return CURSEG_WARM_DATA; if (file_is_hot(inode) || is_inode_flag_set(inode, FI_HOT_DATA) || f2fs_is_atomic_file(inode) || -- 2.18.0.rc1