public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* JFFS2 deadlock in erase callback
@ 2007-10-08  7:43 Adrian Hunter
  2007-10-10 19:51 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: Adrian Hunter @ 2007-10-08  7:43 UTC (permalink / raw)
  To: dwmw2; +Cc: Bityutskiy Artem (Nokia-M/Helsinki), linux-mtd

Hi

We were planning to revert the following:

    commit d364fb18cd991734eb54aa8840e70030b0c9f699
    Author: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
    Date:   Wed Jun 27 01:24:09 2007 +0200

       [JFFS2] Reduce time for which erase_free_sem is held during erase.
    
       With current desing erase_free_sem is locked every time the flash
       block is being erased. For NOR flashes - ~1 second is needed to erase
       single flash block. In the worst case scenario erase_free_sem may be
       locked for a couple of seconds when the number of blocks is being
       erased (e.g. after large file was removed). When erase_free_sem is
       locked all read/write operations for given JFFS2 partition are locked
       too - in effect from time to time access to the JFFS2 partition is
       locked for a number of seconds. This fix makes critical section in
       flash erasing procedure shorter - now erase_free_sem is locked around
       erase_completion_lock spinlock only.
    
       Originally from Radoslaw Bisewski
       Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
       Signed-off-by: David Woodhouse <dwmw2@infradead.org>


because of the deadlock it caused via the erase callback.  Artem, who is away, said you were against moving the callback, but I see you have now done that with the following patch:

    commit 49defc015ff58fda46a3afa3462dfdfa69bc8401
    Author: David Woodhouse <dwmw2@infradead.org>
    Date:   Sat Oct 6 15:01:59 2007 -0400

        [MTD] [NAND] Avoid deadlock in erase callback; release chip lock first.
    
        When the erase callback performs some other action on the flash, it's
        highly likely to deadlock unless we actually release the chip lock
        before calling it.
    
        Signed-off-by: David Woodhouse <dwmw2@infradead.org>


Can you confirm, that adding the "Avoid deadlock..." patch is better than reverting "Reduce time..." patch.

Note the "Avoid deadlock..." change is needed for OneNAND also.


Regards
Adrian Hunter

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: JFFS2 deadlock in erase callback
  2007-10-08  7:43 JFFS2 deadlock in erase callback Adrian Hunter
@ 2007-10-10 19:51 ` Thomas Gleixner
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2007-10-10 19:51 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: Bityutskiy Artem \(Nokia-M/Helsinki\), dwmw2, linux-mtd

On Mon, 8 Oct 2007, Adrian Hunter wrote:
>         [MTD] [NAND] Avoid deadlock in erase callback; release chip lock first.
>     
>         When the erase callback performs some other action on the flash, it's
>         highly likely to deadlock unless we actually release the chip lock
>         before calling it.
>     
>         Signed-off-by: David Woodhouse <dwmw2@infradead.org>
> 
> Can you confirm, that adding the "Avoid deadlock..." patch is better
> than reverting "Reduce time..." patch.

Yep, it's safe and definitely better.

I remember vaguely that we planned/discussed to move the release
before the callback some time ago, but the patch never made it into
mainline.
 
	tglx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-10 19:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-08  7:43 JFFS2 deadlock in erase callback Adrian Hunter
2007-10-10 19:51 ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox