* [UBI] Missing scrub when there is a bit-flip
@ 2011-11-23 13:28 Bhavesh Parekh
2011-11-29 22:15 ` Artem Bityutskiy
0 siblings, 1 reply; 3+ messages in thread
From: Bhavesh Parekh @ 2011-11-23 13:28 UTC (permalink / raw)
To: linux-mtd@lists.infradead.org
Hi All,
I have found a possible problem in the handling of the scrubbing when there is a bit-flip.
We have modified the Nand driver to verify if proper scrubbing is done when bit-flip has happened. For this we injected the bit-flip error from the driver(for a particular block). And we match with corresponding erase call from the upper layer.
We see that some-time when there is a bit-flip we don't found the corresponding erase call. On debugging, we root-cause it to function leb_write_trylock(), where if we don't get the mutex we will return the error and the caller eba_copy_leb will return the error MOVE_CANCEL_RACE to wear_leveling_worker function.
In function wear_leveling_worker, instead of adding back the leb for scrubbing again we are adding that to the protect queue to avoid wear-leveling of this LEB. So in the current implementation we are losing the leb which needs to be scrubbed unless upper layer issues a read for that LEB again and we get the bit-flip again, in that case code is removing the LEB from the protect queue and scheduling a scrubbing.
When we used leb_write_lock instead of leb_write_trylock() then we are seeing matching erase-call for the bit-flips.
So, we are currently thinking 2 possible approaches to fix this:
1. Use leb_write_lock instead of leb_write_trylock(), but leb_write_trylock was used to avoid contention. Will adding back will have side-effect ?
2. Add the leb again in the scrubbing list for scrubbing. There is already code for the same in the implementation, (in out_not_moved case where scrubbed=1 if condition), but since we have set protect=1 we won't go in this condition. We are thinking to return two different error code from the eba_copy_leb base for two different cases in the function (one where volume is removed and another is contention). And only in case of contention set scrubbing=1 and call goto out_not_moved which will add this LEB for scrubbing again.
Which approach we should use in our system ? As we want to guarantee if there is a bit-flip, ubi handles it properly in our system.
Thanks!
Bhavesh
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [UBI] Missing scrub when there is a bit-flip
2011-11-23 13:28 [UBI] Missing scrub when there is a bit-flip Bhavesh Parekh
@ 2011-11-29 22:15 ` Artem Bityutskiy
2011-11-30 12:19 ` Bhavesh Parekh
0 siblings, 1 reply; 3+ messages in thread
From: Artem Bityutskiy @ 2011-11-29 22:15 UTC (permalink / raw)
To: Bhavesh Parekh; +Cc: linux-mtd@lists.infradead.org
Hi, good catch!
On Wed, 2011-11-23 at 18:58 +0530, Bhavesh Parekh wrote:
... snip ...
> When we used leb_write_lock instead of leb_write_trylock() then we are
> seeing matching erase-call for the bit-flips.
>
> So, we are currently thinking 2 possible approaches to fix this:
> 1. Use leb_write_lock instead of leb_write_trylock(), but
> leb_write_trylock was used to avoid contention. Will adding back will
> have side-effect ?
Yeah, there is a big comment which explains that this can cause a
dead-lock, so you cannot use leb_write_lock().
> 2. Add the leb again in the scrubbing list for scrubbing. There is
> already code for the same in the implementation, (in out_not_moved
> case where scrubbed=1 if condition), but since we have set protect=1
> we won't go in this condition. We are thinking to return two
> different error code from the eba_copy_leb base for two different
> cases in the function (one where volume is removed and another is
> contention). And only in case of contention set scrubbing=1 and call
> goto out_not_moved which will add this LEB for scrubbing again.
Yes, this sounds reasonable, introduce a separate return code, like
MOVE_RETRY. Please go ahead and send a patch.
Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [UBI] Missing scrub when there is a bit-flip
2011-11-29 22:15 ` Artem Bityutskiy
@ 2011-11-30 12:19 ` Bhavesh Parekh
0 siblings, 0 replies; 3+ messages in thread
From: Bhavesh Parekh @ 2011-11-30 12:19 UTC (permalink / raw)
To: dedekind1@gmail.com; +Cc: linux-mtd@lists.infradead.org
Hi,
>Yes, this sounds reasonable, introduce a separate return code, like
>MOVE_RETRY. Please go ahead and send a patch.
Added the new return code MOVE_RETRY and handling the same in upper-layer
Bhavesh Parekh (1):
[MTD:UBI] Missing scrub when there is a bit-flip
-Bhavesh
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-11-30 12:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-23 13:28 [UBI] Missing scrub when there is a bit-flip Bhavesh Parekh
2011-11-29 22:15 ` Artem Bityutskiy
2011-11-30 12:19 ` Bhavesh Parekh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox