Re: [PATCH] kernfs: use stack-buf for small writes.

From: Tejun Heo
Date: Tue Sep 23 2014 - 00:13:11 EST


Hello, Neil.

On Tue, Sep 23, 2014 at 02:06:33PM +1000, NeilBrown wrote:
> When mdmon needs to update metadata after a device failure in an array
> there are two 'kmalloc' sources that can trigger deadlock if memory is tight
> and needs to be written to the array (which cannot be allowed until mdmon
> updates the metadata).
> One is in O_DIRECT writes which I have patches for. The other is when
> writing to the sysfs file to tell md that it is safe to continue.
> This simple patch removes the second.

Ugh... :( If this can't be avoided at all, I'd much prefer it to be
something explicit - a flag marking the file as needing a persistent
write buffer which is allocated on open. "Small" writes on stack
feels way to implicit to me.

Thanks.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/