Re: JFFS2 oops when writing to two partitions simultaneously

Joakim Tjernlund
2012-01-26T16:17:31Z

Orjan Friberg <of@flatfrog.com> wrote on 2012/01/26 17:05:15:
>
> On 01/26/2012 04:25 PM, Orjan Friberg wrote:
> > On 01/26/2012 04:17 PM, Joakim Tjernlund wrote:
> >> You could try removing the lock dropping, one at a time, to see if it makes a difference.
> >> That would be a data point for anyone wanting to fix this.
> >
> > I'll turn on CONFIG_DEBUG_SPINLOCK and CONFIG_DEBUG_SPINLOCK_SLEEP and
> > see what happens.
>
> As expected, dropping the lock around kmalloc was fine once I changed
> GFP_KERNEL to GFP_ATOMIC.
>
> Dropping the lock around kfree worked fine (I didn't think it would).
>
> And, as you suggested, we could probably combine those.
>
>
> We must hold the lock when calling this->compress (to protect compr_buf;
> we oops without it) but in doing so I get
>
> BUG: sleeping function called from invalid context at kernel/mutex.c:85
>
> because jffs2_lzo_compress does a mutex_lock.
>
>
> Even if it did work, I think we'd unneccessarily be limiting the
> throughput in that piece of code by holding the lock for that long.

Agreed on all points above :)

Its pretty hopeless to fix too. The only way I can see is to kmalloc
bufs as you need(will be 2 kmalloc's). This would simplify the
code too. I am not going to work on that though as I don't use it and
and don't even like the idea behind it.

Jocke