> Making sure that Alasdair sees this too (hopefully he picked up on it
> from dm-devel, but best send things directly too)
>
> Mikulas, Alasdair? I see the mempool_free() for the "master job", what
> about everything else? Does the dm_kcopyd_prepare_callback() perhaps
> need to do a
>
> job->master_job = job;
>
> or similar?
>
> Linus
>
> On Sun, Oct 23, 2011 at 12:21 PM, Michael Leun <ml@newton.leun.net> wrote:
> > Hi,
> >
> > How to reproduce:
> >
> > lvcreate -L30G -n testsnap vg1 # of course substitute VG as appropriate
> > dd if=/dev/zero of=/dev/vg1/testsnap bs=2M # to make things clear
> > lvcreate -L15G -s /dev/vg1/test -n testsnap
> > dd if=/dev/zero of=/dev/vg1/testsnap bs=2M &
> > watch free
> >
> > I noticed roughly 1GB memory vanishing from free / -/+ buffers/cache
> > per 2GB copied.
> >
> > Bisecting yielded a6e50b409d3f9e0833e69c3c9cca822e8fa4adbb, reverting
> > that from git master cures the memory leak
> >
> > --
> > MfG,
> >
> > Michael Leun
> >
> >
>
BTW. would you like to accept this patch that enables tracking the number
of objects allocated in a mempool and reporting a warning? So that such
bugs could be automatically detected in the future?
---
Introduce an option DEBUG_MEMPOOL. It will check that a mempool is empty
when destroying the mempool.
typedef struct mempool_s {
+#ifdef CONFIG_DEBUG_MEMPOOL
+ atomic_long_t nr_allocated;
+#endif
spinlock_t lock;
int min_nr; /* nr of elements at *elements */
int curr_nr; /* Current nr of elements at *elements */
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel