Re: [RFC/PATCHSET 0/6] perf kmem: Implement page allocation analysis (v1)

From: Ingo Molnar
Date: Mon Mar 16 2015 - 04:27:01 EST



* Namhyung Kim <namhyung@xxxxxxxxxx> wrote:

> On Thu, Mar 12, 2015 at 11:58:37PM +0900, Namhyung Kim wrote:
> > On Thu, Mar 12, 2015 at 11:41:19AM +0100, Ingo Molnar wrote:
> > > So there's one thing that would be useful: to track pages allocated on
> > > one node, but freed on another. Those kinds of allocation/free
> > > patterns are especially expensive and might make sense to visualize.
> >
> > I think it can be done easily as slab analysis already contains the info.
>
> Hmm.. it seems slab events provide the node info but page events
> don't. Without it, I don't know which node a page is in so cannot
> determine such cross-node alloc+free patterns.

Well, but we know the CPU that the allocation occured on, and can map
the CPU to the node.

libnuma can do the mappings, 'man numa' will show you the interfaces,
I think you'll need numa_node_of_cpu().

numalib needs no initialization, and 'perf bench numa' already links
to it - so I think you should be fine just doing:

#include <numa.h>
#include <numaif.h>

and using the API straight away.

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/