Confuse with WL_THRESHOLD

Artem Bityutskiy dedekind at
Mon Jun 8 03:26:04 EDT 2009

On Sun, 2009-06-07 at 13:23 +0300, Artem Bityutskiy wrote:
> On Sat, 2009-06-06 at 07:03 +0700, Thang Dao Duy wrote:
> > Hi everyone.
> > I used NANDsim and ubifs not for along time. Now, I have confused with
> > wear-leveling threshold. If i give parameter WL_THRESHOLD in Kernel is
> > small (example, the value is  3), then when i write a file size 2 MiB
> > to NAND about 200 times, it makes me cannot read EC and VID headers of
> > one PEB (example PEB 10). May be that PEB is bad ? And when i set the
> > WL_THRESHOLD is higher (the value is 20), i write a file 2MiB about
> > 1000 times, nothing 's happen, i can read headers of any PEB. So can
> > you tell me what make this happen, and show me where in ubi source in
> > kernel.
> Looks like a bug. Please, describe precisely how to reproduce it,
> and I'll take a look at this.

Please, also make sure you are using the latest UBI/UBIFS. Please, take
a look here:

I've configured my UBI and made the threshold to be 3 now. I've also
enabled additional UBI and UBIFS debugging checks. I'm running the
following test:

$ sudo modprobe nandsim
$ sudo modprobe ubi mtd=0
$ sudo ubimkvol /dev/ubi0 -m -N test_fs
Set volume size to 128674304
Volume ID 0, size 8107 LEBs (128674304 bytes, 122.7 MiB), LEB size 15872 bytes (15.5 KiB), dynamic, name "test_fs", alignment 1
$ sudo modprobe ubifs
$ sudo mount -t ubifs ubi0:test_fs /mnt/ubifs/
$ while true; do sudo dd if=/dev/urandom of=ubifs/file count=2048; sync; done
2097152 bytes (2.1 MB) copied, 0.316768 s, 6.6 MB/s                                            
4096+0 records in                                                                              
4096+0 records out                                                                             

It's being run for some time now, so far so good - no issues.

Best regards,
Artem Bityutskiy (Битюцкий Артём)

More information about the linux-mtd mailing list