Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4375473ybi; Mon, 3 Jun 2019 09:49:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqxHcD14S8Q3oa9RiZHseqGeH1Rxcw0P5Ph0JKjM0b4VyDDn+nD25ks/uWUPVrvBXQsZHmCc X-Received: by 2002:a17:902:2aab:: with SMTP id j40mr31604737plb.238.1559580593725; Mon, 03 Jun 2019 09:49:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559580593; cv=none; d=google.com; s=arc-20160816; b=nI7ByTAkfYRtGzo699NviumLWCXUgafqf9TI0aEbuK91Bk9EfQMVH+vha3kEfi8pkN XbUcirO41zCYEOLaNbP1eCp5HLRxf6yLzVlo7pauxOXlKSnKidFftgFhCrd8SdWedvky yAEbsq2+lpsT3SOwrZl1OMz74KxfA8kRInVNCwgNAQv8pJ1q0dWJvmz+oyxk8cHMIslP iXtQWZAYYEDMVYTiJUL41GitcOWbtS8eC6rSGXAOse72tisZhlVOEftDd+b7CV/op3Ih GSKyCR3k/cqTVTVnQeXeOQqtNmEtKKqZyKbfBHEnzjFYNMQnyjQGi0zq+ygJfPF4jhwM /h1w== 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=LirmImDDRaqrXGdKFJts0GZij5g3j2qdYN+tNyUK9Jc=; b=LA9jrsyvQqe7XzGwvpTgSDwWiPv2tm7biIJnjt5JZEWUd95cdf437jsLNGXtCujXhA JZPzZfLoCMifzDVkWc8lP9F5yMSx+Z0qmBeBp1rSuNA3qjZZSBSJBRPxPxZWhXYW7kfm oU7N8opF0ejcHy/19mzeEazZ6pUrAJLQWGSGm7dPM0MG9PP2vhp1Gp9F6yOsv8ncxwLw B+5lmV3E0ZW68XgtdZttcWD0+WhK+qcO7QyXab9qnJ/UxQCWrwpnsUyn0KZW9UUIr9Vp tZXinPcl+UB+/ql1V+EosqL70GsvV8Zpt/lwvdTqBMvxPkOWVaawkRj3NP9n1HnzbLc4 pUww== 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 6si21775373pld.293.2019.06.03.09.49.36; Mon, 03 Jun 2019 09:49:53 -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 S1726988AbfFCKdi (ORCPT + 99 others); Mon, 3 Jun 2019 06:33:38 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:17658 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726880AbfFCKdi (ORCPT ); Mon, 3 Jun 2019 06:33:38 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 6AC133B6A349DDDE4E72; Mon, 3 Jun 2019 18:33:35 +0800 (CST) Received: from [10.134.22.195] (10.134.22.195) by smtp.huawei.com (10.3.19.213) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 3 Jun 2019 18:33:31 +0800 Subject: Re: [PATCH v3 1/4] f2fs: Lower threshold for disable_cp_again To: Daniel Rosenberg , Jaegeuk Kim , Jonathan Corbet , CC: , , , References: <20190530004906.261170-1-drosen@google.com> <20190530004906.261170-2-drosen@google.com> From: Chao Yu Message-ID: <1246dcc9-800a-ef0e-7cd0-199a0a6d77d4@huawei.com> Date: Mon, 3 Jun 2019 18:33:30 +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: <20190530004906.261170-2-drosen@google.com> Content-Type: text/plain; charset="utf-8" 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 2019/5/30 8:49, Daniel Rosenberg wrote: > The existing threshold for allowable holes at checkpoint=disable time is > too high. The OVP space contains reserved segments, which are always in > the form of free segments. These must be subtracted from the OVP value. > > The current threshold is meant to be the maximum value of holes of a > single type we can have and still guarantee that we can fill the disk > without failing to find space for a block of a given type. > > If the disk is full, ignoring current reserved, which only helps us, > the amount of unused blocks is equal to the OVP area. Of that, there > are reserved segments, which must be free segments, and the rest of the > ovp area, which can come from either free segments or holes. The maximum > possible amount of holes is OVP-reserved. > > Now, consider the disk when mounting with checkpoint=disable. > We must be able to fill all available free space with either data or > node blocks. When we start with checkpoint=disable, holes are locked to > their current type. Say we have H of one type of hole, and H+X of the > other. We can fill H of that space with arbitrary typed blocks via SSR. > For the remaining H+X blocks, we may not have any of a given block type > left at all. For instance, if we were to fill the disk entirely with > blocks of the type with fewer holes, the H+X blocks of the opposite type > would not be used. If H+X > OVP-reserved, there would be more holes than > could possibly exist, and we would have failed to find a suitable block > earlier on, leading to a crash in update_sit_entry. > > If H+X <= OVP-reserved, then the holes end up effectively masked by the OVP > region in this case. > > Signed-off-by: Daniel Rosenberg Reviewed-by: Chao Yu Thanks,