Bug 216341 - ubi: small erase counter of fm_anchor after disabling fastmap
Summary: ubi: small erase counter of fm_anchor after disabling fastmap
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-09 03:00 UTC by Zhihao Cheng
Modified: 2022-08-09 06:15 UTC (History)
0 users

See Also:
Kernel Version: 5.19-rc7
Subsystem:
Regression: No
Bisected commit-id:


Attachments
setup.sh (1.32 KB, application/x-shellscript)
2022-08-09 03:02 UTC, Zhihao Cheng
Details
diff.patch (871 bytes, patch)
2022-08-09 03:02 UTC, Zhihao Cheng
Details | Diff
delay_v2.patch (907 bytes, patch)
2022-08-09 06:15 UTC, Zhihao Cheng
Details | Diff

Description Zhihao Cheng 2022-08-09 03:00:49 UTC
CONFIG_MTD_UBI_FASTMAP=y
CONFIG_MTD_UBI_WL_THRESHOLD=50

1. Generate an ubi image with fastmap
./setup.sh 1
umount temp
ubidetach -m0
dd if=/dev/mtd0 of=disk

2. Disable fastmap, apply diff.patch and re-compile kernel
3. ./setup.sh
4. ~/xfstests-dev/ltp/fsstress -d temp -l 0 -n 100000 -p 4
5. Several minutes(10min~) later

=========================================================
from              to     count      min      avg      max
---------------------------------------------------------
0        ..        9:        1        4        4        4
10       ..       99:        0        0        0        0
100      ..      999:      399      835      858      886
1000     ..     9999:        0        0        0        0
10000    ..    99999:        0        0        0        0
100000   ..      inf:        0        0        0        0
---------------------------------------------------------
Total               :      400        4      856      886

$ dmesg
[ 1189.836985] anchor 7
[ 1189.847611] anchor 7
[ 1189.859065] anchor 7

$ cat /sys/kernel/debug/ubi/ubi0/detailed_erase_block_info
physical_block_number   erase_count
0                       939        
1                       904        
2                       923        
3                       904        
4                       940        
5                       913        
6                       930        
7                       9          # The erase counter of fm_anchor PEB is smaller than any other PEBs
8                       905        
9                       902        
10                      945        
11                      916        
12                      922        
13                      923        
14                      900        
15                      927
Comment 1 Zhihao Cheng 2022-08-09 03:02:02 UTC
Created attachment 301535 [details]
setup.sh
Comment 2 Zhihao Cheng 2022-08-09 03:02:59 UTC
Created attachment 301536 [details]
diff.patch
Comment 3 Zhihao Cheng 2022-08-09 06:15:19 UTC
(In reply to Zhihao Cheng from comment #2)
> Created attachment 301536 [details]
> diff.patch

Use diff_v2.patch
Comment 4 Zhihao Cheng 2022-08-09 06:15:33 UTC
Created attachment 301537 [details]
delay_v2.patch

Note You need to log in before you can comment on or make changes to this bug.