From: Minchan Kim <minchan@kernel.org>
To: John Hubbard <jhubbard@nvidia.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
gregkh@linuxfoundation.org, surenb@google.com,
joaodias@google.com, LKML <linux-kernel@vger.kernel.org>,
linux-mm <linux-mm@kvack.org>
Subject: Re: [PATCH] mm: cma: support sysfs
Date: Thu, 4 Feb 2021 22:24:14 -0800 [thread overview]
Message-ID: <YBzkjh5nnuNiGb6Q@google.com> (raw)
In-Reply-To: <34110c61-9826-4cbe-8cd4-76f5e7612dbd@nvidia.com>
On Thu, Feb 04, 2021 at 09:49:54PM -0800, John Hubbard wrote:
> On 2/4/21 9:17 PM, Minchan Kim wrote:
> ...
> > > > > Presumably, having the source code, you can easily deduce that a bluetooth
> > > > > allocation failure goes directly to a CMA allocation failure, right?
> > >
> > > Still wondering about this...
> >
> > It would work if we have full source code and stack are not complicated for
> > every usecases. Having said, having a good central place automatically
> > popped up is also beneficial for not to add similar statistics for each
> > call sites.
> >
> > Why do we have too many item in slab sysfs instead of creating each call
> > site inventing on each own?
> >
>
> I'm not sure I understand that question fully, but I don't think we need to
> invent anything unique here. So far we've discussed debugfs, sysfs, and /proc,
> none of which are new mechanisms.
I thought you asked why we couldn't add those stat in their call site
driver syfs instead of central place. Please clarify if I misunderstood
your question.
>
> ...
>
> > > It's actually easier to monitor one or two simpler items than it is to monitor
> > > a larger number of complicated items. And I get the impression that this is
> > > sort of a top-level, production software indicator.
> >
> > Let me clarify one more time.
> >
> > What I'd like to get ultimately is per-CMA statistics instead of
> > global vmstat for the usecase at this moment. Global vmstat
> > could help the decision whether I should go deeper but it ends up
> > needing per-CMA statistics. And I'd like to keep them in sysfs,
> > not debugfs since it should be stable as a telemetric.
> >
> > What points do you disagree in this view?
>
>
> No huge disagreements, I just want to get us down to the true essential elements
> of what is required--and find a good home for the data. Initial debugging always
> has excesses, and those should not end up in the more carefully vetted production
> code.
>
> If I were doing this, I'd probably consider HugeTLB pages as an example to follow,
> because they have a lot in common with CMA: it's another memory allocation pool, and
> people also want to monitor it.
>
> HugeTLB pages and THP pages are monitored in /proc:
> /proc/meminfo and /proc/vmstat:
>
> # cat meminfo |grep -i huge
> AnonHugePages: 88064 kB
> ShmemHugePages: 0 kB
> FileHugePages: 0 kB
> HugePages_Total: 500
> HugePages_Free: 500
> HugePages_Rsvd: 0
> HugePages_Surp: 0
> Hugepagesize: 2048 kB
> Hugetlb: 1024000 kB
>
> # cat vmstat | grep -i huge
> nr_shmem_hugepages 0
> nr_file_hugepages 0
> nr_anon_transparent_hugepages 43
> numa_huge_pte_updates 0
>
> ...aha, so is CMA:
>
> # cat vmstat | grep -i cma
> nr_free_cma 261718
>
> # cat meminfo | grep -i cma
> CmaTotal: 1048576 kB
> CmaFree: 1046872 kB
>
> OK, given that CMA is already in those two locations, maybe we should put
> this information in one or both of those, yes?
Do you suggest something liks this, for example?
cat vmstat | grep -i cma
cma_a_success 125
cma_a_fail 25
cma_b_success 130
cma_b_fail 156
..
cma_f_fail xxx
next prev parent reply other threads:[~2021-02-05 6:27 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-03 15:50 [PATCH] mm: cma: support sysfs Minchan Kim
2021-02-04 8:50 ` John Hubbard
2021-02-04 20:07 ` Minchan Kim
2021-02-04 23:14 ` John Hubbard
2021-02-04 23:43 ` Suren Baghdasaryan
2021-02-04 23:45 ` Suren Baghdasaryan
2021-02-05 0:25 ` John Hubbard
2021-02-05 0:34 ` John Hubbard
2021-02-05 1:44 ` Suren Baghdasaryan
2021-02-05 0:12 ` Minchan Kim
2021-02-05 0:24 ` John Hubbard
2021-02-05 1:44 ` Minchan Kim
2021-02-05 2:39 ` Suren Baghdasaryan
2021-02-05 2:52 ` John Hubbard
2021-02-05 5:17 ` Minchan Kim
2021-02-05 5:49 ` John Hubbard
2021-02-05 6:24 ` Minchan Kim [this message]
2021-02-05 6:41 ` John Hubbard
2021-02-05 16:15 ` Minchan Kim
2021-02-05 20:25 ` John Hubbard
2021-02-05 21:28 ` Minchan Kim
2021-02-05 21:52 ` Suren Baghdasaryan
2021-02-05 21:58 ` John Hubbard
2021-02-05 22:47 ` Minchan Kim
2021-02-06 17:08 ` Pintu Agarwal
2021-02-08 8:39 ` John Hubbard
2021-02-05 21:57 ` John Hubbard
2021-02-05 2:55 ` Matthew Wilcox
2021-02-05 5:22 ` Minchan Kim
2021-02-05 12:12 ` Matthew Wilcox
2021-02-05 16:16 ` Minchan Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YBzkjh5nnuNiGb6Q@google.com \
--to=minchan@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=gregkh@linuxfoundation.org \
--cc=jhubbard@nvidia.com \
--cc=joaodias@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=surenb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).