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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
-- 
[email protected]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux