[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20061218195604.GA32112@elte.hu>
Date: Mon, 18 Dec 2006 20:56:04 +0100
From: Ingo Molnar <mingo@...e.hu>
To: Catalin Marinas <catalin.marinas@...il.com>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2.6.20-rc1 00/10] Kernel memory leak detector 0.13
* Catalin Marinas <catalin.marinas@...il.com> wrote:
> >at freeing we only have to look up the tree belonging to object->cpu.
>
> At freeing, kmemleak only gets a pointer value which has to be looked
> up in the hash table for the corresponding memleak_object. Only after
> that, we can know memleak_object->cpu. That's why I think we only need
> to have a global hash table. The hash table look-up can be RCU.
>
> It would work with per-CPU hash tables but we still need to look-up
> the other hash tables in case the freeing happened on a different CPU
> (i.e. look-up the current hash table and, if it fails, look-up the
> other per-CPU hashes). Freeing would need to remove the entry from the
> hash table and acquire a lock but this would be per-CPU. I'm not sure
> how often you get this scenario (allocation and freeing on different
> CPUs) but it might introduce an overhead to the memory freeing.
>
> Do you have a better solution here?
hmm ... nasty. Would it be feasible to embedd the memleak info into the
allocated object itself? That would remove quite some runtime overhead,
besides eliminating the global hash.
Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists