[PATCH 00/12] ubi: fastmap: Fix a series of wear leveling problems

Zhihao Cheng chengzhihao1 at huawei.com
Sat Aug 12 00:59:53 PDT 2023


This series of patches fix three problems:
1. Inconsistent erase counter from wl entry and disk, for patches 1~4.
2. Same PEB is always resued for fastmap data, for patches 5~9.
3. First 64 PEBs have large erase counter than others, for patches 10~12.

Besides, patches 4/5 bring an improvement of the UBI service life.

Regression tests are in https://bugzilla.kernel.org/show_bug.cgi?id=217787.


Zhihao Cheng (12):
  ubi: fastmap: Fix missed ec updating after erasing old fastmap data
    block
  ubi: fastmap: erase_block: Get erase counter from wl_entry rather than
    flash
  ubi: fastmap: Allocate memory with GFP_NOFS in ubi_update_fastmap
  ubi: Replace erase_block() with sync_erase()
  ubi: fastmap: Use free pebs reserved for bad block handling
  ubi: fastmap: Wait until there are enough free PEBs before filling
    pools
  ubi: fastmap: Remove unneeded break condition while filling pools
  ubi: fastmap: may_reserve_for_fm: Don't reserve PEB if fm_anchor
    exists
  ubi: fastmap: Get wl PEB even ec beyonds the 'max' if free PEBs are
    run out
  ubi: fastmap: Fix lapsed wear leveling for first 64 PEBs
  ubi: fastmap: Add module parameter to control reserving filling pool
    PEBs
  ubi: fastmap: Add control in 'UBI_IOCATT' ioctl to reserve PEBs for
    filling pools

 drivers/mtd/ubi/build.c      |  25 +++++++-
 drivers/mtd/ubi/cdev.c       |   3 +-
 drivers/mtd/ubi/eba.c        |   3 -
 drivers/mtd/ubi/fastmap-wl.c | 113 ++++++++++++++++++++++++++++-------
 drivers/mtd/ubi/fastmap.c    |  66 +++-----------------
 drivers/mtd/ubi/ubi.h        |  10 +++-
 drivers/mtd/ubi/wl.c         |  34 ++++++-----
 drivers/mtd/ubi/wl.h         |   6 +-
 include/uapi/mtd/ubi-user.h  |   4 +-
 9 files changed, 156 insertions(+), 108 deletions(-)

-- 
2.39.2




More information about the linux-mtd mailing list