Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2076751ybv; Fri, 14 Feb 2020 11:01:31 -0800 (PST) X-Google-Smtp-Source: APXvYqyeIq6XMXJL2NFd3nFOUNBUt0McWuTWXyQio/+PopDbEdvH04c6UDzgPzhDN11uYpgFMjU8 X-Received: by 2002:aca:5f87:: with SMTP id t129mr2915900oib.36.1581706891181; Fri, 14 Feb 2020 11:01:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581706891; cv=none; d=google.com; s=arc-20160816; b=v1DjNXf0hsiPeddxmFsPbPmRk/1+65jQsiiL6HQNHvoQ/2n6XgoUC085dzlmV6vmmP IQGxpBIlVw7z2qUjlpsRibupf6BWlrHLZYLqcSBh6lrmvifYtDvxsix9w/nVUNWSVfYp TcT2CB0Un36/i9SJVGWuTLTyNPasP5+ws81dYFvNVNkvT4tFidNsCE6XE6atYtrP1HuJ c2FUcFRG2WUoESSnlY8VS3n/CMVzkNoZckM2sfbQsbLpB2sj1aJzF4uROEifce1d2SHz hL1t1B3s0MB+r8cWdZ8AWB8ENQrjUi1Z2OL2QXJA2K3N1MRtKnZPX3MMkvSrYfXsEY9i LEIQ== 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=pNDYzxAgmOve1pGMQ750xdW6hJanhz57BB0dHUWxryM=; b=GLc/+YObfER+MaaQRdrSeemXN0vLuHSmHlZga/if7V3ofC8HdTbS9Yk/kVdH/IS0+j iD2cEeRRBKL8F6sQOcGiMYYNbMvBj1uDz0Y1M/NQujO/F+6c5SC8SvaJAz4+ziMqh9P1 XALSZh7jfkpcysremRmeZs0nuY12/eevbKtOBzyv+/aqJnume+5X0FdvKuWHMSzCY6fd WOCSRWVjLg150Qo296f/HUIc+sLvo7HWTVS6YG7PvgzCZji/lLN9rXuz39VcbgGEroqf CWfn3ReuCliypqGEfWda4Ix1jMqMkl9i0BYRyMwlID8WJJXY5joSUx2sZJTkAMEqLMdF ALsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qHZpcGNu; 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 w11si3316330oic.62.2020.02.14.11.01.19; Fri, 14 Feb 2020 11:01:31 -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=qHZpcGNu; 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 S2387611AbgBNS66 (ORCPT + 99 others); Fri, 14 Feb 2020 13:58:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:46104 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729210AbgBNS65 (ORCPT ); Fri, 14 Feb 2020 13:58:57 -0500 Received: from localhost (unknown [104.132.1.66]) (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 3E9EC206CC; Fri, 14 Feb 2020 18:58:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581706737; bh=hN7SPeLJCWEGiPDKat8V/+hhK7EWj0c4fKIn0VjGFk0=; h=From:To:Cc:Subject:Date:From; b=qHZpcGNuWvHNt/z3H9CN/IMRyi0p2dBOzNsijHzhWgXo8NjQ2NUxR0eGpaLmS55hK yLfOG8hj01HDsWBYgeHp4kTgK/XMeuyZYrcPAz6zdc2fSXFrEsZcj7WWCMOFSjfp+T uRvfQcKsdF7F6a4eJ+oSQXIYfuACGsrYmKAWfquU= From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH 1/3] f2fs: skip GC when section is full Date: Fri, 14 Feb 2020 10:58:53 -0800 Message-Id: <20200214185855.217360-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.25.0.265.gbab2e86ba0-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 This fixes skipping GC when segment is full in large section. Signed-off-by: Jaegeuk Kim --- fs/f2fs/gc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 53312d7bc78b..65c0687ee2bb 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -1018,8 +1018,8 @@ static int gc_data_segment(struct f2fs_sb_info *sbi, struct f2fs_summary *sum, * race condition along with SSR block allocation. */ if ((gc_type == BG_GC && has_not_enough_free_secs(sbi, 0, 0)) || - get_valid_blocks(sbi, segno, false) == - sbi->blocks_per_seg) + get_valid_blocks(sbi, segno, true) == + BLKS_PER_SEC(sbi)) return submitted; if (check_valid_map(sbi, segno, off) == 0) -- 2.25.0.265.gbab2e86ba0-goog