Skip to content

Commit 415e472

Browse files
Zhihao Chengrichardweinberger
authored andcommitted
ubi: fastmap: Remove unneeded break condition while filling pools
Change pool filling stop condition. Commit d09e9a2 ("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>
1 parent a2ea69d commit 415e472

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/mtd/ubi/fastmap-wl.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ static void wait_free_pebs_for_pool(struct ubi_device *ubi)
142142
* @ubi: UBI device description object
143143
*
144144
* This helper function checks whether there are enough free pebs (deducted
145-
* by fastmap pebs) to fill fm_pool and fm_wl_pool, above rule works after
146-
* there is at least one of free pebs is filled into fm_wl_pool.
145+
* by fastmap pebs) to fill fm_pool and fm_wl_pool.
147146
*/
148147
static bool has_enough_free_count(struct ubi_device *ubi)
149148
{
@@ -152,7 +151,7 @@ static bool has_enough_free_count(struct ubi_device *ubi)
152151
if (!ubi->free.rb_node)
153152
return false;
154153

155-
if (ubi->fm_wl_pool.size > 0 && !(ubi->ro_mode || ubi->fm_disabled))
154+
if (!ubi->ro_mode && !ubi->fm_disabled)
156155
fm_used = ubi->fm_size / ubi->leb_size - 1;
157156

158157
return ubi->free_count > fm_used;

0 commit comments

Comments
 (0)