aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhihao Cheng <chengzhihao1@huawei.com>2023-08-28 14:38:40 +0800
committerRichard Weinberger <richard@nod.at>2023-10-28 22:47:43 +0200
commit415e4723c4325464d489c1ef3335eb6679905471 (patch)
tree05c791f028178ac08503877513cdfeac48b91fe1
parenta2ea69dac674df0fba59c66146a21145108a85ed (diff)
downloadubifs-415e4723c4325464d489c1ef3335eb6679905471.tar.gz
ubi: fastmap: Remove unneeded break condition while filling pools
Change pool filling stop condition. Commit d09e9a2bddba ("ubi: fastmap: Fix high cpu usage of ubi_bgt by making sure wl_pool not empty") reserves fastmap data PEBs after filling 1 PEB in wl_pool. Now wait_free_pebs_for_pool() makes enough free PEBs before filling pool, there will still be at least 1 PEB in pool and 1 PEB in wl_pool after doing ubi_refill_pools(). Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: Richard Weinberger <richard@nod.at>
-rw-r--r--drivers/mtd/ubi/fastmap-wl.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/mtd/ubi/fastmap-wl.c b/drivers/mtd/ubi/fastmap-wl.c
index 12854717915a5..7c4cfd80da317 100644
--- a/drivers/mtd/ubi/fastmap-wl.c
+++ b/drivers/mtd/ubi/fastmap-wl.c
@@ -142,8 +142,7 @@ static void wait_free_pebs_for_pool(struct ubi_device *ubi)
* @ubi: UBI device description object
*
* This helper function checks whether there are enough free pebs (deducted
- * by fastmap pebs) to fill fm_pool and fm_wl_pool, above rule works after
- * there is at least one of free pebs is filled into fm_wl_pool.
+ * by fastmap pebs) to fill fm_pool and fm_wl_pool.
*/
static bool has_enough_free_count(struct ubi_device *ubi)
{
@@ -152,7 +151,7 @@ static bool has_enough_free_count(struct ubi_device *ubi)
if (!ubi->free.rb_node)
return false;
- if (ubi->fm_wl_pool.size > 0 && !(ubi->ro_mode || ubi->fm_disabled))
+ if (!ubi->ro_mode && !ubi->fm_disabled)
fm_used = ubi->fm_size / ubi->leb_size - 1;
return ubi->free_count > fm_used;