Re: [PATCH 3/3] mm/kmemleak.c: Merge the consecutive scan-areas.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 14, 2013 at 12:49:51PM +0100, majianpeng wrote:
> If the scan-areas are adjacent,it can merge in order to reduce memomy.

Have you found any significant reduction in the memory size?

What we miss though is removing an area (and I found a use-case for it).

> +    hlist_for_each_entry(area, &object->area_list, node) {
> +        if (ptr + size == area->start) {
> +            area->start = ptr;
> +            area->size += size;
> +            goto out_unlock;
> +        } else if (ptr == area->start + area->size) {
> +            area->size += size;
> +            goto out_unlock;

I prefer to keep 'goto' only for the error path. You could add a 'bool
merged' and another 'if' block for area allocation.

I'll pick the other too patches.

Thanks.

-- 
Catalin

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]