[dm-devel] Re: [PATCH 1/3] sysfs representation of stacked devices (dm/md common)

Alasdair G Kergon agk at redhat.com
Fri Feb 17 18:44:35 UTC 2006


Make sure you test this properly under low memory situations.

On Fri, Feb 17, 2006 at 01:01:48PM -0500, Jun'ichi Nomura wrote:
> This patch provides common functions to create symlinks in sysfs
> between stacked device and its slaves.

dm_swap_table() mustn't block waiting for memory to become
free (except in a controlled way e.g. with a mempool, but
it would need more than that here).

Here, dm_swap_table() leads to kmalloc() getting called
in sysfs_add_link().

[e.g. Consider the extreme case where the dm device
you're changing is your swap device.  While dm_swap_table()
runs, no I/O will get through to your swap device.]

If you can't avoid the sysfs code allocating memory, then
you must find a way of doing it before the dm suspend or
after the dm resume.
e.g. Do the sysfs memory allocations for the links prior to 
the dm suspend [which may have happened in a previous system call] 
and then use a different function to move them into place during
dm_swap_table() without performing further memory allocations?
[Lazy workaround is to set PF_MEMALLOC again...]

Alasdair
-- 
agk at redhat.com




More information about the dm-devel mailing list