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

From: Alasdair G Kergon
Date: Tue Feb 21 2006 - 10:50:57 EST


On Tue, Feb 21, 2006 at 10:33:40AM -0500, Jun'ichi Nomura wrote:
> Alasdair G Kergon wrote:
> >Test with trees of devices too - where a whole tree is suspended -
> Suspending maps in the tree and reload one of them?

Reload a complete tree of devices like lvm2 does:
It loads inactivate tables wherever it needs to in the tree,
then suspends the devices in the correct order (according to
the dependencies of the live tables to avoid ever 'trapping' I/O
between two devices), then resumes them in order.

> >I don't think you can allocate anywhere in dm_swap_table()
> >without PF_MEMALLOC (which I recently removed and am reluctant
> >to reinstate).

> I understand your reluctance and I don't want to revive it either.
> I think moving sysfs_add_link() outside of dm_swap_table() solves
> this. Am I right?

I should have said: try hard to avoid allocations in any code run
during the 'DM_SUSPEND' ioctl - if you really have to, your options
include PF_MEMALLOC or a mempool, as appropriate.

> Or do you want to eliminate the possibility that sysfs_remove_symlink()
> may require memory allocation in future?

Either that, or:

> Anyway, I'll seek for bd_claim based approach.

This dodges the allocation problem because it happens in the DM_TABLE_LOAD
ioctl where I was able to remove the restriction recently.

Alasdair
--
agk@xxxxxxxxxx
-
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/