Re: [PATCH v2] mm: cma: print cma name as well in cma_alloc debug

From: Pintu Agarwal
Date: Sat Jul 08 2023 - 02:52:23 EST


On Fri, 7 Jul 2023 at 20:03, Pintu Agarwal <pintu.ping@xxxxxxxxx> wrote:
>
> On Fri, 7 Jul 2023 at 19:52, Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote:
> >
> > On Fri, Jul 07, 2023 at 07:46:31PM +0530, Pintu Agarwal wrote:
> > > On Fri, 7 Jul 2023 at 19:40, Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote:
> > > > > One more question from here:
> > > > > pr_debug("%s(cma %p, name: %s, count %lu, align %d)\n", __func__,
> > > > > (void *)cma, cma->name, count, align);
> > > > >
> > > > > Do we really need this "cma %p" printing ?
> > > > > I hardly check it and simply rely on name and count.
> > > >
> > > > Printing pointers is almost always a bad idea. Printing the base_pfn
> > > > might be a good idea to distinguish CMAs which happen to have the
> > > > same name?
> > > >
> > > No there is no name there, it's just a ptrval
> > > cma: cma_alloc(cma (ptrval), name: reserved, count 64, align 6)
> >
> > You misunderstand me. I don't know how CMAs get their name. Is it not
> > possible for two CMAs to have the same name as each other?
> >
> Oh yah that is possible, for example multiple players can use the same
> global cma region.

Yes, I think it's a good idea to include base_pfn instead of printing pointers.
Let's complete the cma->name inclusion first.
Later I will check about base_pfn and push in another patch.
Thanks