Linux LVM users
 help / color / mirror / Atom feed
* [linux-lvm] vgchange -a memory consumption
@ 2008-07-12  5:57 Daniel Stodden
  2008-07-12 16:51 ` Alasdair G Kergon
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Stodden @ 2008-07-12  5:57 UTC (permalink / raw)
  To: Linux LVM


Hi.

I'm running, lvm2-2.02.26.

Found that vgchange -a y/n generates remarkable memory consumption on
volumes with larger numbers of small volumes.

Tried on a VG with 1024 LVs of 8MB each. Interestingly, the type of
operation does not seem to matter much. Notably, deactivating an already
unavailable volume group generates similarly high pressure than actually
activating it.

Looking at the code, I've got only gained a partial understanding where
the memory is exactly spent -- and for what. So much I believe I do
understand, maybe someone can enlighten me:

Iterating through all the volumes pushes the data segment up by about
750k -- per iteration. That memory allocated per volume never seems to
get freed.

So, together with the memory locking performed in lock_vol, it's only a
matter of installed RAM and volume numbers when the OOM killer will kick
in.

_vg_read() seems to play a role. Apparently replayed twice for each LV
(once for lock, then for unlock). 

To a rather outside observer like me, the path taken to get there seems
rather strange. The LV is handed over as a UUID string to lock_vol().
In the '-an' case, this is handed over to lv_deactivate, which will
(re-)load both the VG and LV metadata in order to get the respective
lvinfo struct. 

So what I don't really get is: 

Why is that data reread? Especially the VG metadata. Or am I missing
something. Second: why isn't that memory freed after returning from
activate_lv?

But most importantly: Could this be fixed?

Best,
Daniel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-07-16 20:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-12  5:57 [linux-lvm] vgchange -a memory consumption Daniel Stodden
2008-07-12 16:51 ` Alasdair G Kergon
2008-07-15  6:19   ` Daniel Stodden
2008-07-16 16:48     ` [PATCH] " Daniel Stodden
     [not found]       ` <20080716165243.GM7155@agk.fab.redhat.com>
     [not found]         ` <1216228176.1130.13.camel@desktop>
     [not found]           ` <20080716174240.GN7155@agk.fab.redhat.com>
     [not found]             ` <1216231344.16876.25.camel@desktop>
2008-07-16 18:08               ` Daniel Stodden
2008-07-16 20:39             ` [PATCH2] " Daniel Stodden

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox