[PATCH] [linux-lvm] vgchange -a memory consumption

Daniel Stodden daniel.stodden at citrix.com
Wed Jul 16 18:08:28 UTC 2008

On Wed, 2008-07-16 at 11:02 -0700, Daniel Stodden wrote:
> On Wed, 2008-07-16 at 18:42 +0100, Alasdair G Kergon wrote:
> > Quick way for starters, is allocate a pointless object in the pool
> > then free eveything back to that point each time round the loop.
> Thought so. Thanks for suggesting it.
> > But proper thing is to track down into the library and find
> > which routines are the ones where the pool can be freed at
> > the end and isn't being.
> Let's take lv_deactivate() in activate.c as an example.
> We'd have
> 	lv = lv_from_lvid() 
> and then would do a:
> 	dm_pool_free(lv->vg)
> or something similar, because we know the VG is constructed before th LV
> can be found. That's what I meant with 'non-obvious'.
> That example wasn't even a very good fix, because it appears to still
> leave a tip hanging around. Didn't figure exactly what it was.

Did you ever consider to have the part behind lock_vol() allocate it's
own pool (let's call it tmp) for temporary storage? So e.g.
lv_from_lvid() would read the VG into tmp and the lv it actally returns
into cmd->mem?

That would be a much larger change, but probably the cleaner way to do

... not like I'm looking for extra work or something :]


More information about the linux-lvm mailing list