From patchwork Wed Feb 22 12:50:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunlong Song X-Patchwork-Id: 9586763 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C5751602A7 for ; Wed, 22 Feb 2017 12:39:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ADF8E2867A for ; Wed, 22 Feb 2017 12:39:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A266528698; Wed, 22 Feb 2017 12:39:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78D052867A for ; Wed, 22 Feb 2017 12:39:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932194AbdBVMi5 (ORCPT ); Wed, 22 Feb 2017 07:38:57 -0500 Received: from szxga03-in.huawei.com ([45.249.212.189]:2940 "EHLO dggrg03-dlp.huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1754324AbdBVMi4 (ORCPT ); Wed, 22 Feb 2017 07:38:56 -0500 Received: from 172.30.72.54 (EHLO DGGEMM404-HUB.china.huawei.com) ([172.30.72.54]) by dggrg03-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id AIY50345; Wed, 22 Feb 2017 20:38:42 +0800 (CST) Received: from DGGEML404-HUB.china.huawei.com (10.3.17.39) by DGGEMM404-HUB.china.huawei.com (10.3.20.212) with Microsoft SMTP Server (TLS) id 14.3.301.0; Wed, 22 Feb 2017 20:38:41 +0800 Received: from s00293685.huawei.com (10.108.111.190) by DGGEML404-HUB.china.huawei.com (10.3.17.39) with Microsoft SMTP Server id 14.3.301.0; Wed, 22 Feb 2017 20:38:32 +0800 From: Yunlong Song To: , , , , , , CC: , , , Subject: [PATCH 2/3] f2fs: provide more chance to get node ssr Date: Wed, 22 Feb 2017 20:50:50 +0800 Message-ID: <1487767851-819-2-git-send-email-yunlong.song@huawei.com> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <1487767851-819-1-git-send-email-yunlong.song@huawei.com> References: <1487767851-819-1-git-send-email-yunlong.song@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.108.111.190] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020203.58AD8652.02E8, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: c1400fb172fdfcfaeb0dea8e8ef54e95 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Yunlong Song --- fs/f2fs/segment.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 80997f5..9d13743 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1541,9 +1541,13 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type) struct curseg_info *curseg = CURSEG_I(sbi, type); const struct victim_selection *v_ops = DIRTY_I(sbi)->v_ops; - if (IS_NODESEG(type)) - return v_ops->get_victim(sbi, - &(curseg)->next_segno, BG_GC, type, SSR); + if (IS_NODESEG(type)) { + for (; type >= CURSEG_HOT_NODE; type--) + if (v_ops->get_victim(sbi, &(curseg)->next_segno, + BG_GC, type, SSR)) + return 1; + return 0; + } /* For data segments, let's do SSR more intensively */ for (; type >= CURSEG_HOT_DATA; type--)