Re: [PATCH] mm: cma: support sysfs

2021-02-08 Thread John Hubbard
On 2/6/21 9:08 AM, Pintu Agarwal wrote: ... # cat meminfo | grep -i cma CmaTotal:1048576 kB CmaFree: 1046872 kB This CMA info was added by me way back in 2014. At that time I even thought about adding this cma alloc/fail counter in vmstat. That time I also had an internal patch

Re: [PATCH] mm: cma: support sysfs

2021-02-06 Thread Pintu Agarwal
On Sat, 6 Feb 2021 at 04:17, Minchan Kim wrote: > > On Fri, Feb 05, 2021 at 01:58:06PM -0800, John Hubbard wrote: > > On 2/5/21 1:52 PM, Suren Baghdasaryan wrote: > > > > > > I takes your suggestion something like this. > > > > > > > > > > > > [alloc_range] could be order or range by interval > >

Re: [PATCH] mm: cma: support sysfs

2021-02-05 Thread John Hubbard
On 2/5/21 1:28 PM, Minchan Kim wrote: On Fri, Feb 05, 2021 at 12:25:52PM -0800, John Hubbard wrote: On 2/5/21 8:15 AM, Minchan Kim wrote: ... OK. But...what *is* your goal, and why is this useless (that's what orthogonal really means here) for your goal? As I mentioned, the goal is to monitor

Re: [PATCH] mm: cma: support sysfs

2021-02-05 Thread John Hubbard
On 2/5/21 1:52 PM, Suren Baghdasaryan wrote: I takes your suggestion something like this. [alloc_range] could be order or range by interval /sys/kernel/mm/cma/cma-A/[alloc_range]/success /sys/kernel/mm/cma/cma-A/[alloc_range]/fail .. .. /sys/kernel/mm/cma/cma-Z/[alloc_range]/success /sys/kernel

Re: [PATCH] mm: cma: support sysfs

2021-02-05 Thread Minchan Kim
On Fri, Feb 05, 2021 at 01:58:06PM -0800, John Hubbard wrote: > On 2/5/21 1:52 PM, Suren Baghdasaryan wrote: > > > > > I takes your suggestion something like this. > > > > > > > > > > [alloc_range] could be order or range by interval > > > > > > > > > > /sys/kernel/mm/cma/cma-A/[alloc_range]/succ

Re: [PATCH] mm: cma: support sysfs

2021-02-05 Thread Minchan Kim
On Thu, Feb 04, 2021 at 10:41:14PM -0800, John Hubbard wrote: > On 2/4/21 10:24 PM, Minchan Kim wrote: > > On Thu, Feb 04, 2021 at 09:49:54PM -0800, John Hubbard wrote: > > > On 2/4/21 9:17 PM, Minchan Kim wrote: > ... > > > # cat vmstat | grep -i cma > > > nr_free_cma 261718 > > > > > > # cat mem

Re: [PATCH] mm: cma: support sysfs

2021-02-05 Thread Minchan Kim
On Fri, Feb 05, 2021 at 12:12:17PM +, Matthew Wilcox wrote: > On Thu, Feb 04, 2021 at 09:22:18PM -0800, Minchan Kim wrote: > > > > + for (i = 0; i < cma_area_count; i++) { > > > > + cma = &cma_areas[i]; > > > > + stat = kzalloc(sizeof(*stat), GFP_KERNEL); > > >

Re: [PATCH] mm: cma: support sysfs

2021-02-05 Thread Suren Baghdasaryan
On Fri, Feb 5, 2021 at 1:28 PM Minchan Kim wrote: > > On Fri, Feb 05, 2021 at 12:25:52PM -0800, John Hubbard wrote: > > On 2/5/21 8:15 AM, Minchan Kim wrote: > > ... > > > > Yes, approximately. I was wondering if this would suffice at least as a > > > > baseline: > > > > > > > > cma_alloc_success

Re: [PATCH] mm: cma: support sysfs

2021-02-05 Thread Minchan Kim
On Fri, Feb 05, 2021 at 12:25:52PM -0800, John Hubbard wrote: > On 2/5/21 8:15 AM, Minchan Kim wrote: > ... > > > Yes, approximately. I was wondering if this would suffice at least as a > > > baseline: > > > > > > cma_alloc_success 125 > > > cma_alloc_failure 25 > > > > IMO, regardless of th

Re: [PATCH] mm: cma: support sysfs

2021-02-05 Thread John Hubbard
On 2/5/21 8:15 AM, Minchan Kim wrote: ... Yes, approximately. I was wondering if this would suffice at least as a baseline: cma_alloc_success 125 cma_alloc_failure 25 IMO, regardless of the my patch, it would be good to have such statistics in that CMA was born to replace carved out memor

Re: [PATCH] mm: cma: support sysfs

2021-02-05 Thread Matthew Wilcox
On Thu, Feb 04, 2021 at 09:22:18PM -0800, Minchan Kim wrote: > > > + for (i = 0; i < cma_area_count; i++) { > > > + cma = &cma_areas[i]; > > > + stat = kzalloc(sizeof(*stat), GFP_KERNEL); > > > + if (!stat) > > > + goto out; > > > > How many cma areas are th

Re: [PATCH] mm: cma: support sysfs

2021-02-04 Thread John Hubbard
On 2/4/21 10:24 PM, Minchan Kim wrote: On Thu, Feb 04, 2021 at 09:49:54PM -0800, John Hubbard wrote: On 2/4/21 9:17 PM, Minchan Kim wrote: ... # cat vmstat | grep -i cma nr_free_cma 261718 # cat meminfo | grep -i cma CmaTotal:1048576 kB CmaFree: 1046872 kB OK, given that CMA

Re: [PATCH] mm: cma: support sysfs

2021-02-04 Thread Minchan Kim
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? > > > > > > Sti

Re: [PATCH] mm: cma: support sysfs

2021-02-04 Thread John Hubbard
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 e

Re: [PATCH] mm: cma: support sysfs

2021-02-04 Thread Minchan Kim
On Fri, Feb 05, 2021 at 02:55:26AM +, Matthew Wilcox wrote: > On Wed, Feb 03, 2021 at 07:50:01AM -0800, Minchan Kim wrote: > > +++ b/mm/Makefile > > @@ -106,6 +106,7 @@ obj-$(CONFIG_ZSMALLOC) += zsmalloc.o > > obj-$(CONFIG_Z3FOLD) += z3fold.o > > obj-$(CONFIG_GENERIC_EARLY_IOREMAP) +=

Re: [PATCH] mm: cma: support sysfs

2021-02-04 Thread Minchan Kim
On Thu, Feb 04, 2021 at 06:52:01PM -0800, John Hubbard wrote: > On 2/4/21 5:44 PM, Minchan Kim wrote: > > On Thu, Feb 04, 2021 at 04:24:20PM -0800, John Hubbard wrote: > > > On 2/4/21 4:12 PM, Minchan Kim wrote: > > > ... > > > > > > Then, how to know how often CMA API failed? > > > > > > > > > >

Re: [PATCH] mm: cma: support sysfs

2021-02-04 Thread Matthew Wilcox
On Wed, Feb 03, 2021 at 07:50:01AM -0800, Minchan Kim wrote: > +++ b/mm/Makefile > @@ -106,6 +106,7 @@ obj-$(CONFIG_ZSMALLOC)+= zsmalloc.o > obj-$(CONFIG_Z3FOLD) += z3fold.o > obj-$(CONFIG_GENERIC_EARLY_IOREMAP) += early_ioremap.o > obj-$(CONFIG_CMA)+= cma.o > +obj-$(CONFIG_SYSFS) +=

Re: [PATCH] mm: cma: support sysfs

2021-02-04 Thread John Hubbard
On 2/4/21 5:44 PM, Minchan Kim wrote: On Thu, Feb 04, 2021 at 04:24:20PM -0800, John Hubbard wrote: On 2/4/21 4:12 PM, Minchan Kim wrote: ... Then, how to know how often CMA API failed? Why would you even need to know that, *in addition* to knowing specific page allocation numbers that failed

Re: [PATCH] mm: cma: support sysfs

2021-02-04 Thread Suren Baghdasaryan
On Thu, Feb 4, 2021 at 5:44 PM Minchan Kim wrote: > > On Thu, Feb 04, 2021 at 04:24:20PM -0800, John Hubbard wrote: > > On 2/4/21 4:12 PM, Minchan Kim wrote: > > ... > > > > > Then, how to know how often CMA API failed? > > > > > > > > Why would you even need to know that, *in addition* to knowing

Re: [PATCH] mm: cma: support sysfs

2021-02-04 Thread Suren Baghdasaryan
On Thu, Feb 4, 2021 at 4:34 PM John Hubbard wrote: > > On 2/4/21 4:25 PM, John Hubbard wrote: > > On 2/4/21 3:45 PM, Suren Baghdasaryan wrote: > > ... > >> 2) The overall CMA allocation attempts/failures (first two items > >> above) seem > >> an odd pair of things to track. Maybe that

Re: [PATCH] mm: cma: support sysfs

2021-02-04 Thread Minchan Kim
On Thu, Feb 04, 2021 at 04:24:20PM -0800, John Hubbard wrote: > On 2/4/21 4:12 PM, Minchan Kim wrote: > ... > > > > Then, how to know how often CMA API failed? > > > > > > Why would you even need to know that, *in addition* to knowing specific > > > page allocation numbers that failed? Again, ther

Re: [PATCH] mm: cma: support sysfs

2021-02-04 Thread John Hubbard
On 2/4/21 4:25 PM, John Hubbard wrote: On 2/4/21 3:45 PM, Suren Baghdasaryan wrote: ... 2) The overall CMA allocation attempts/failures (first two items above) seem an odd pair of things to track. Maybe that is what was easy to track, but I'd vote for just omitting them. Then, how to know how

Re: [PATCH] mm: cma: support sysfs

2021-02-04 Thread John Hubbard
On 2/4/21 3:45 PM, Suren Baghdasaryan wrote: ... 2) The overall CMA allocation attempts/failures (first two items above) seem an odd pair of things to track. Maybe that is what was easy to track, but I'd vote for just omitting them. Then, how to know how often CMA API failed? Why would you ev

Re: [PATCH] mm: cma: support sysfs

2021-02-04 Thread John Hubbard
On 2/4/21 4:12 PM, Minchan Kim wrote: ... Then, how to know how often CMA API failed? Why would you even need to know that, *in addition* to knowing specific page allocation numbers that failed? Again, there is no real-world motivation cited yet, just "this is good data". Need more stories and

Re: [PATCH] mm: cma: support sysfs

2021-02-04 Thread Minchan Kim
On Thu, Feb 04, 2021 at 03:14:56PM -0800, John Hubbard wrote: > On 2/4/21 12:07 PM, Minchan Kim wrote: > > On Thu, Feb 04, 2021 at 12:50:58AM -0800, John Hubbard wrote: > > > On 2/3/21 7:50 AM, Minchan Kim wrote: > > > > Since CMA is getting used more widely, it's more important to > > > > keep mon

Re: [PATCH] mm: cma: support sysfs

2021-02-04 Thread Suren Baghdasaryan
On Thu, Feb 4, 2021 at 3:43 PM Suren Baghdasaryan wrote: > > On Thu, Feb 4, 2021 at 3:14 PM John Hubbard wrote: > > > > On 2/4/21 12:07 PM, Minchan Kim wrote: > > > On Thu, Feb 04, 2021 at 12:50:58AM -0800, John Hubbard wrote: > > >> On 2/3/21 7:50 AM, Minchan Kim wrote: > > >>> Since CMA is gett

Re: [PATCH] mm: cma: support sysfs

2021-02-04 Thread Suren Baghdasaryan
On Thu, Feb 4, 2021 at 3:14 PM John Hubbard wrote: > > On 2/4/21 12:07 PM, Minchan Kim wrote: > > On Thu, Feb 04, 2021 at 12:50:58AM -0800, John Hubbard wrote: > >> On 2/3/21 7:50 AM, Minchan Kim wrote: > >>> Since CMA is getting used more widely, it's more important to > >>> keep monitoring CMA s

Re: [PATCH] mm: cma: support sysfs

2021-02-04 Thread John Hubbard
On 2/4/21 12:07 PM, Minchan Kim wrote: On Thu, Feb 04, 2021 at 12:50:58AM -0800, John Hubbard wrote: On 2/3/21 7:50 AM, Minchan Kim wrote: Since CMA is getting used more widely, it's more important to keep monitoring CMA statistics for system health since it's directly related to user experienc

Re: [PATCH] mm: cma: support sysfs

2021-02-04 Thread Minchan Kim
On Thu, Feb 04, 2021 at 12:50:58AM -0800, John Hubbard wrote: > On 2/3/21 7:50 AM, Minchan Kim wrote: > > Since CMA is getting used more widely, it's more important to > > keep monitoring CMA statistics for system health since it's > > directly related to user experience. > > > > This patch introd

Re: [PATCH] mm: cma: support sysfs

2021-02-04 Thread John Hubbard
On 2/3/21 7:50 AM, Minchan Kim wrote: Since CMA is getting used more widely, it's more important to keep monitoring CMA statistics for system health since it's directly related to user experience. This patch introduces sysfs for the CMA and exposes stats below to keep monitor for telemetric in t

[PATCH] mm: cma: support sysfs

2021-02-03 Thread Minchan Kim
Since CMA is getting used more widely, it's more important to keep monitoring CMA statistics for system health since it's directly related to user experience. This patch introduces sysfs for the CMA and exposes stats below to keep monitor for telemetric in the system. * the number of CMA allocat