On Wed, 19 Jul 2017 18:44:03 +0800 Zhaoyang Huang <[email protected]> 
wrote:

> /proc/vmallocinfo will not show the area allocated by vm_map_ram, which
> will make confusion when debug. Add vm_struct for them and show them in
> proc.
> 

Please provide sample /proc/vmallocinfo so we can better understand the
proposal.  Is there a means by which people can determine that a
particular area is from vm_map_ram()?  I don't think so.  Should there
be?

>
> ...
>
> @@ -1173,6 +1178,12 @@ void *vm_map_ram(struct page **pages, unsigned int 
> count, int node, pgprot_t pro
>               addr = (unsigned long)mem;
>       } else {
>               struct vmap_area *va;
> +             struct vm_struct *area;
> +
> +             area = kzalloc_node(sizeof(*area), GFP_KERNEL, node);
> +             if (unlikely(!area))
> +                     return NULL;

Allocating a vm_struct for each vm_map_ram area is a cost.  And we're
doing this purely for /proc/vmallocinfo.  I think I'll need more
persuading to convince me that this is a good tradeoff, given that
*every* user will incur this cost, and approximately 0% of them will
ever use /proc/vmallocinfo.

So... do we *really* need this?  If so, why?

Reply via email to