linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] CMA: add the amount of cma memory in meminfo
@ 2014-12-04  2:54 Xishi Qiu
  2014-12-04 16:26 ` Michal Nazarewicz
  2014-12-05 17:41 ` Michal Nazarewicz
  0 siblings, 2 replies; 6+ messages in thread
From: Xishi Qiu @ 2014-12-04  2:54 UTC (permalink / raw)
  To: Andrew Morton, m.szyprowski, mina86, aneesh.kumar, iamjoonsoo.kim
  Cc: LKML, Linux MM, Xishi Qiu

Add the amount of cma memory in the following meminfo.
/proc/meminfo
/sys/devices/system/node/nodeXX/meminfo

Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
---
 drivers/base/node.c | 16 ++++++++++------
 fs/proc/meminfo.c   | 12 +++++++++---
 2 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/drivers/base/node.c b/drivers/base/node.c
index 472168c..a27e4e0 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -120,6 +120,9 @@ static ssize_t node_read_meminfo(struct device *dev,
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
 		       "Node %d AnonHugePages:  %8lu kB\n"
 #endif
+#ifdef CONFIG_CMA
+		       "Node %d FreeCMAPages:   %8lu kB\n"
+#endif
 			,
 		       nid, K(node_page_state(nid, NR_FILE_DIRTY)),
 		       nid, K(node_page_state(nid, NR_WRITEBACK)),
@@ -136,14 +139,15 @@ static ssize_t node_read_meminfo(struct device *dev,
 		       nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE) +
 				node_page_state(nid, NR_SLAB_UNRECLAIMABLE)),
 		       nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE)),
-#ifdef CONFIG_TRANSPARENT_HUGEPAGE
 		       nid, K(node_page_state(nid, NR_SLAB_UNRECLAIMABLE))
-			, nid,
-			K(node_page_state(nid, NR_ANON_TRANSPARENT_HUGEPAGES) *
-			HPAGE_PMD_NR));
-#else
-		       nid, K(node_page_state(nid, NR_SLAB_UNRECLAIMABLE)));
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+		       , nid, K(node_page_state(nid,
+				NR_ANON_TRANSPARENT_HUGEPAGES) * HPAGE_PMD_NR)
+#endif
+#ifdef CONFIG_CMA
+		       , nid, K(node_page_state(nid, NR_FREE_CMA_PAGES))
 #endif
+			);
 	n += hugetlb_report_node_meminfo(nid, buf + n);
 	return n;
 }
diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
index aa1eee0..d42e082 100644
--- a/fs/proc/meminfo.c
+++ b/fs/proc/meminfo.c
@@ -138,6 +138,9 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
 		"AnonHugePages:  %8lu kB\n"
 #endif
+#ifdef CONFIG_CMA
+		"FreeCMAPages:   %8lu kB\n"
+#endif
 		,
 		K(i.totalram),
 		K(i.freeram),
@@ -187,11 +190,14 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
 		vmi.used >> 10,
 		vmi.largest_chunk >> 10
 #ifdef CONFIG_MEMORY_FAILURE
-		,atomic_long_read(&num_poisoned_pages) << (PAGE_SHIFT - 10)
+		, atomic_long_read(&num_poisoned_pages) << (PAGE_SHIFT - 10)
 #endif
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
-		,K(global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
-		   HPAGE_PMD_NR)
+		, K(global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
+				HPAGE_PMD_NR)
+#endif
+#ifdef CONFIG_CMA
+		, K(global_page_state(NR_FREE_CMA_PAGES))
 #endif
 		);
 
-- 
2.0.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] CMA: add the amount of cma memory in meminfo
  2014-12-04  2:54 [PATCH] CMA: add the amount of cma memory in meminfo Xishi Qiu
@ 2014-12-04 16:26 ` Michal Nazarewicz
  2014-12-05  1:42   ` Xishi Qiu
  2014-12-05 17:41 ` Michal Nazarewicz
  1 sibling, 1 reply; 6+ messages in thread
From: Michal Nazarewicz @ 2014-12-04 16:26 UTC (permalink / raw)
  To: Xishi Qiu, Andrew Morton, m.szyprowski, aneesh.kumar, iamjoonsoo.kim
  Cc: LKML, Linux MM, Xishi Qiu

On Thu, Dec 04 2014, Xishi Qiu <qiuxishi@huawei.com> wrote:
> Add the amount of cma memory in the following meminfo.
> /proc/meminfo
> /sys/devices/system/node/nodeXX/meminfo
>
> Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
> ---
>  drivers/base/node.c | 16 ++++++++++------
>  fs/proc/meminfo.c   | 12 +++++++++---
>  2 files changed, 19 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/base/node.c b/drivers/base/node.c
> index 472168c..a27e4e0 100644
> --- a/drivers/base/node.c
> +++ b/drivers/base/node.c
> @@ -120,6 +120,9 @@ static ssize_t node_read_meminfo(struct device *dev,
>  #ifdef CONFIG_TRANSPARENT_HUGEPAGE
>  		       "Node %d AnonHugePages:  %8lu kB\n"
>  #endif
> +#ifdef CONFIG_CMA
> +		       "Node %d FreeCMAPages:   %8lu kB\n"
> +#endif
>  			,
>  		       nid, K(node_page_state(nid, NR_FILE_DIRTY)),
>  		       nid, K(node_page_state(nid, NR_WRITEBACK)),
> @@ -136,14 +139,15 @@ static ssize_t node_read_meminfo(struct device *dev,
>  		       nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE) +
>  				node_page_state(nid, NR_SLAB_UNRECLAIMABLE)),
>  		       nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE)),
> -#ifdef CONFIG_TRANSPARENT_HUGEPAGE
>  		       nid, K(node_page_state(nid, NR_SLAB_UNRECLAIMABLE))

Why is this line suddenly out of “#ifdef CONFIG_TRANSPARENT_HUGEPAGE”?

> -			, nid,
> -			K(node_page_state(nid, NR_ANON_TRANSPARENT_HUGEPAGES) *
> -			HPAGE_PMD_NR));
> -#else
> -		       nid, K(node_page_state(nid, NR_SLAB_UNRECLAIMABLE)));
> +#ifdef CONFIG_TRANSPARENT_HUGEPAGE
> +		       , nid, K(node_page_state(nid,
> +				NR_ANON_TRANSPARENT_HUGEPAGES) * HPAGE_PMD_NR)

This is mere white-space change which is confusing.

> +#endif
> +#ifdef CONFIG_CMA
> +		       , nid, K(node_page_state(nid, NR_FREE_CMA_PAGES))
>  #endif
> +			);
>  	n += hugetlb_report_node_meminfo(nid, buf + n);
>  	return n;
>  }
> diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
> index aa1eee0..d42e082 100644
> --- a/fs/proc/meminfo.c
> +++ b/fs/proc/meminfo.c
> @@ -138,6 +138,9 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
>  #ifdef CONFIG_TRANSPARENT_HUGEPAGE
>  		"AnonHugePages:  %8lu kB\n"
>  #endif
> +#ifdef CONFIG_CMA
> +		"FreeCMAPages:   %8lu kB\n"
> +#endif
>  		,
>  		K(i.totalram),
>  		K(i.freeram),
> @@ -187,11 +190,14 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
>  		vmi.used >> 10,
>  		vmi.largest_chunk >> 10
>  #ifdef CONFIG_MEMORY_FAILURE
> -		,atomic_long_read(&num_poisoned_pages) << (PAGE_SHIFT - 10)
> +		, atomic_long_read(&num_poisoned_pages) << (PAGE_SHIFT - 10)
>  #endif
>  #ifdef CONFIG_TRANSPARENT_HUGEPAGE
> -		,K(global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
> -		   HPAGE_PMD_NR)
> +		, K(global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
> +				HPAGE_PMD_NR)
> +#endif

Again, please don't include white space changes.  They are confusing.

> +#ifdef CONFIG_CMA
> +		, K(global_page_state(NR_FREE_CMA_PAGES))
>  #endif
>  		);
>  
> -- 
> 2.0.0
>
>

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +--<mpn@google.com>--<xmpp:mina86@jabber.org>--ooO--(_)--Ooo--

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] CMA: add the amount of cma memory in meminfo
  2014-12-04 16:26 ` Michal Nazarewicz
@ 2014-12-05  1:42   ` Xishi Qiu
  0 siblings, 0 replies; 6+ messages in thread
From: Xishi Qiu @ 2014-12-05  1:42 UTC (permalink / raw)
  To: Michal Nazarewicz
  Cc: Andrew Morton, m.szyprowski, aneesh.kumar, iamjoonsoo.kim, LKML,
	Linux MM

On 2014/12/5 0:26, Michal Nazarewicz wrote:

> On Thu, Dec 04 2014, Xishi Qiu <qiuxishi@huawei.com> wrote:
>> Add the amount of cma memory in the following meminfo.
>> /proc/meminfo
>> /sys/devices/system/node/nodeXX/meminfo
>>
>> Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
>> ---
>>  drivers/base/node.c | 16 ++++++++++------
>>  fs/proc/meminfo.c   | 12 +++++++++---
>>  2 files changed, 19 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/base/node.c b/drivers/base/node.c
>> index 472168c..a27e4e0 100644
>> --- a/drivers/base/node.c
>> +++ b/drivers/base/node.c
>> @@ -120,6 +120,9 @@ static ssize_t node_read_meminfo(struct device *dev,
>>  #ifdef CONFIG_TRANSPARENT_HUGEPAGE
>>  		       "Node %d AnonHugePages:  %8lu kB\n"
>>  #endif
>> +#ifdef CONFIG_CMA
>> +		       "Node %d FreeCMAPages:   %8lu kB\n"
>> +#endif
>>  			,
>>  		       nid, K(node_page_state(nid, NR_FILE_DIRTY)),
>>  		       nid, K(node_page_state(nid, NR_WRITEBACK)),
>> @@ -136,14 +139,15 @@ static ssize_t node_read_meminfo(struct device *dev,
>>  		       nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE) +
>>  				node_page_state(nid, NR_SLAB_UNRECLAIMABLE)),
>>  		       nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE)),
>> -#ifdef CONFIG_TRANSPARENT_HUGEPAGE
>>  		       nid, K(node_page_state(nid, NR_SLAB_UNRECLAIMABLE))
> 
> Why is this line suddenly out of “#ifdef CONFIG_TRANSPARENT_HUGEPAGE”?
> 

Hi Michal,

The original code is like this.
			...
  #ifdef CONFIG_TRANSPARENT_HUGEPAGE
		       nid, K(node_page_state(nid, NR_SLAB_UNRECLAIMABLE))
			, nid,
			K(node_page_state(nid, NR_ANON_TRANSPARENT_HUGEPAGES) *
			HPAGE_PMD_NR));
  #else
		       nid, K(node_page_state(nid, NR_SLAB_UNRECLAIMABLE)));
  #endif
			...

I change it to like this, just move ");" out of the "#ifdef".
			...
                       nid, K(node_page_state(nid, NR_SLAB_UNRECLAIMABLE))
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
                       , nid, K(node_page_state(nid,
                                NR_ANON_TRANSPARENT_HUGEPAGES) * HPAGE_PMD_NR)
 #endif
			);
			...

>> -			, nid,
>> -			K(node_page_state(nid, NR_ANON_TRANSPARENT_HUGEPAGES) *
>> -			HPAGE_PMD_NR));
>> -#else
>> -		       nid, K(node_page_state(nid, NR_SLAB_UNRECLAIMABLE)));
>> +#ifdef CONFIG_TRANSPARENT_HUGEPAGE
>> +		       , nid, K(node_page_state(nid,
>> +				NR_ANON_TRANSPARENT_HUGEPAGES) * HPAGE_PMD_NR)
> 
> This is mere white-space change which is confusing.
> 

you mean change like this ", nid, K(...)" -> ",nid, K(xxx)"?

Thanks,
Xishi Qiu

>> +#endif
>> +#ifdef CONFIG_CMA
>> +		       , nid, K(node_page_state(nid, NR_FREE_CMA_PAGES))
>>  #endif
>> +			);
>>  	n += hugetlb_report_node_meminfo(nid, buf + n);
>>  	return n;
>>  }
>> diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
>> index aa1eee0..d42e082 100644
>> --- a/fs/proc/meminfo.c
>> +++ b/fs/proc/meminfo.c
>> @@ -138,6 +138,9 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
>>  #ifdef CONFIG_TRANSPARENT_HUGEPAGE
>>  		"AnonHugePages:  %8lu kB\n"
>>  #endif
>> +#ifdef CONFIG_CMA
>> +		"FreeCMAPages:   %8lu kB\n"
>> +#endif
>>  		,
>>  		K(i.totalram),
>>  		K(i.freeram),
>> @@ -187,11 +190,14 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
>>  		vmi.used >> 10,
>>  		vmi.largest_chunk >> 10
>>  #ifdef CONFIG_MEMORY_FAILURE
>> -		,atomic_long_read(&num_poisoned_pages) << (PAGE_SHIFT - 10)
>> +		, atomic_long_read(&num_poisoned_pages) << (PAGE_SHIFT - 10)
>>  #endif
>>  #ifdef CONFIG_TRANSPARENT_HUGEPAGE
>> -		,K(global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
>> -		   HPAGE_PMD_NR)
>> +		, K(global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
>> +				HPAGE_PMD_NR)
>> +#endif
> 
> Again, please don't include white space changes.  They are confusing.
> 
>> +#ifdef CONFIG_CMA
>> +		, K(global_page_state(NR_FREE_CMA_PAGES))
>>  #endif
>>  		);
>>  
>> -- 
>> 2.0.0
>>
>>
> 




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] CMA: add the amount of cma memory in meminfo
  2014-12-04  2:54 [PATCH] CMA: add the amount of cma memory in meminfo Xishi Qiu
  2014-12-04 16:26 ` Michal Nazarewicz
@ 2014-12-05 17:41 ` Michal Nazarewicz
  2014-12-15  1:37   ` Xishi Qiu
  1 sibling, 1 reply; 6+ messages in thread
From: Michal Nazarewicz @ 2014-12-05 17:41 UTC (permalink / raw)
  To: Xishi Qiu, Andrew Morton, m.szyprowski, aneesh.kumar, iamjoonsoo.kim
  Cc: LKML, Linux MM, Xishi Qiu

On Thu, Dec 04 2014, Xishi Qiu <qiuxishi@huawei.com> wrote:
> Add the amount of cma memory in the following meminfo.
> /proc/meminfo
> /sys/devices/system/node/nodeXX/meminfo
>
> Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>

No second look:

Acked-by: Michal Nazarewicz <mina86@mina86.com>

> ---
>  drivers/base/node.c | 16 ++++++++++------
>  fs/proc/meminfo.c   | 12 +++++++++---
>  2 files changed, 19 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/base/node.c b/drivers/base/node.c
> index 472168c..a27e4e0 100644
> --- a/drivers/base/node.c
> +++ b/drivers/base/node.c
> @@ -120,6 +120,9 @@ static ssize_t node_read_meminfo(struct device *dev,
>  #ifdef CONFIG_TRANSPARENT_HUGEPAGE
>  		       "Node %d AnonHugePages:  %8lu kB\n"
>  #endif
> +#ifdef CONFIG_CMA
> +		       "Node %d FreeCMAPages:   %8lu kB\n"
> +#endif
>  			,
>  		       nid, K(node_page_state(nid, NR_FILE_DIRTY)),
>  		       nid, K(node_page_state(nid, NR_WRITEBACK)),
> @@ -136,14 +139,15 @@ static ssize_t node_read_meminfo(struct device *dev,
>  		       nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE) +
>  				node_page_state(nid, NR_SLAB_UNRECLAIMABLE)),
>  		       nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE)),
> -#ifdef CONFIG_TRANSPARENT_HUGEPAGE
>  		       nid, K(node_page_state(nid, NR_SLAB_UNRECLAIMABLE))
> -			, nid,
> -			K(node_page_state(nid, NR_ANON_TRANSPARENT_HUGEPAGES) *
> -			HPAGE_PMD_NR));
> -#else
> -		       nid, K(node_page_state(nid, NR_SLAB_UNRECLAIMABLE)));
> +#ifdef CONFIG_TRANSPARENT_HUGEPAGE
> +		       , nid, K(node_page_state(nid,
> +				NR_ANON_TRANSPARENT_HUGEPAGES) * HPAGE_PMD_NR)
> +#endif
> +#ifdef CONFIG_CMA
> +		       , nid, K(node_page_state(nid, NR_FREE_CMA_PAGES))
>  #endif
> +			);
>  	n += hugetlb_report_node_meminfo(nid, buf + n);
>  	return n;
>  }
> diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
> index aa1eee0..d42e082 100644
> --- a/fs/proc/meminfo.c
> +++ b/fs/proc/meminfo.c
> @@ -138,6 +138,9 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
>  #ifdef CONFIG_TRANSPARENT_HUGEPAGE
>  		"AnonHugePages:  %8lu kB\n"
>  #endif
> +#ifdef CONFIG_CMA
> +		"FreeCMAPages:   %8lu kB\n"
> +#endif
>  		,
>  		K(i.totalram),
>  		K(i.freeram),
> @@ -187,11 +190,14 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
>  		vmi.used >> 10,
>  		vmi.largest_chunk >> 10
>  #ifdef CONFIG_MEMORY_FAILURE
> -		,atomic_long_read(&num_poisoned_pages) << (PAGE_SHIFT - 10)
> +		, atomic_long_read(&num_poisoned_pages) << (PAGE_SHIFT - 10)
>  #endif
>  #ifdef CONFIG_TRANSPARENT_HUGEPAGE
> -		,K(global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
> -		   HPAGE_PMD_NR)
> +		, K(global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
> +				HPAGE_PMD_NR)
> +#endif
> +#ifdef CONFIG_CMA
> +		, K(global_page_state(NR_FREE_CMA_PAGES))
>  #endif
>  		);
>  
> -- 
> 2.0.0
>
>

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +--<mpn@google.com>--<xmpp:mina86@jabber.org>--ooO--(_)--Ooo--

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] CMA: add the amount of cma memory in meminfo
  2014-12-05 17:41 ` Michal Nazarewicz
@ 2014-12-15  1:37   ` Xishi Qiu
  2014-12-18 19:21     ` Michal Nazarewicz
  0 siblings, 1 reply; 6+ messages in thread
From: Xishi Qiu @ 2014-12-15  1:37 UTC (permalink / raw)
  To: Michal Nazarewicz
  Cc: Andrew Morton, m.szyprowski, aneesh.kumar, iamjoonsoo.kim, LKML,
	Linux MM

On 2014/12/6 1:41, Michal Nazarewicz wrote:

> On Thu, Dec 04 2014, Xishi Qiu <qiuxishi@huawei.com> wrote:
>> Add the amount of cma memory in the following meminfo.
>> /proc/meminfo
>> /sys/devices/system/node/nodeXX/meminfo
>>
>> Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
> 
> No second look:
> 
> Acked-by: Michal Nazarewicz <mina86@mina86.com>
> 
>> ---
>>  drivers/base/node.c | 16 ++++++++++------
>>  fs/proc/meminfo.c   | 12 +++++++++---
>>  2 files changed, 19 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/base/node.c b/drivers/base/node.c
>> index 472168c..a27e4e0 100644
>> --- a/drivers/base/node.c
>> +++ b/drivers/base/node.c
>> @@ -120,6 +120,9 @@ static ssize_t node_read_meminfo(struct device *dev,
>>  #ifdef CONFIG_TRANSPARENT_HUGEPAGE
>>  		       "Node %d AnonHugePages:  %8lu kB\n"
>>  #endif
>> +#ifdef CONFIG_CMA
>> +		       "Node %d FreeCMAPages:   %8lu kB\n"
>> +#endif
>>  			,
>>  		       nid, K(node_page_state(nid, NR_FILE_DIRTY)),
>>  		       nid, K(node_page_state(nid, NR_WRITEBACK)),
>> @@ -136,14 +139,15 @@ static ssize_t node_read_meminfo(struct device *dev,
>>  		       nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE) +
>>  				node_page_state(nid, NR_SLAB_UNRECLAIMABLE)),
>>  		       nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE)),
>> -#ifdef CONFIG_TRANSPARENT_HUGEPAGE
>>  		       nid, K(node_page_state(nid, NR_SLAB_UNRECLAIMABLE))
>> -			, nid,
>> -			K(node_page_state(nid, NR_ANON_TRANSPARENT_HUGEPAGES) *
>> -			HPAGE_PMD_NR));
>> -#else
>> -		       nid, K(node_page_state(nid, NR_SLAB_UNRECLAIMABLE)));
>> +#ifdef CONFIG_TRANSPARENT_HUGEPAGE
>> +		       , nid, K(node_page_state(nid,
>> +				NR_ANON_TRANSPARENT_HUGEPAGES) * HPAGE_PMD_NR)

Hi Michal,

The "mere white-space change" you said a few days ago,how about change like this
", nid, K(...)" -> ",nid, K(xxx)"?

Thanks,
Xishi Qiu

>> +#endif
>> +#ifdef CONFIG_CMA
>> +		       , nid, K(node_page_state(nid, NR_FREE_CMA_PAGES))
>>  #endif
>> +			);
>>  	n += hugetlb_report_node_meminfo(nid, buf + n);
>>  	return n;
>>  }
>> diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
>> index aa1eee0..d42e082 100644
>> --- a/fs/proc/meminfo.c
>> +++ b/fs/proc/meminfo.c
>> @@ -138,6 +138,9 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
>>  #ifdef CONFIG_TRANSPARENT_HUGEPAGE
>>  		"AnonHugePages:  %8lu kB\n"
>>  #endif
>> +#ifdef CONFIG_CMA
>> +		"FreeCMAPages:   %8lu kB\n"
>> +#endif
>>  		,
>>  		K(i.totalram),
>>  		K(i.freeram),
>> @@ -187,11 +190,14 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
>>  		vmi.used >> 10,
>>  		vmi.largest_chunk >> 10
>>  #ifdef CONFIG_MEMORY_FAILURE
>> -		,atomic_long_read(&num_poisoned_pages) << (PAGE_SHIFT - 10)
>> +		, atomic_long_read(&num_poisoned_pages) << (PAGE_SHIFT - 10)
>>  #endif
>>  #ifdef CONFIG_TRANSPARENT_HUGEPAGE
>> -		,K(global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
>> -		   HPAGE_PMD_NR)
>> +		, K(global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
>> +				HPAGE_PMD_NR)
>> +#endif
>> +#ifdef CONFIG_CMA
>> +		, K(global_page_state(NR_FREE_CMA_PAGES))
>>  #endif
>>  		);
>>  
>> -- 
>> 2.0.0
>>
>>
> 




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] CMA: add the amount of cma memory in meminfo
  2014-12-15  1:37   ` Xishi Qiu
@ 2014-12-18 19:21     ` Michal Nazarewicz
  0 siblings, 0 replies; 6+ messages in thread
From: Michal Nazarewicz @ 2014-12-18 19:21 UTC (permalink / raw)
  To: Xishi Qiu
  Cc: Andrew Morton, m.szyprowski, aneesh.kumar, iamjoonsoo.kim, LKML,
	Linux MM

On Mon, Dec 15 2014, Xishi Qiu <qiuxishi@huawei.com> wrote:
> The "mere white-space change" you said a few days ago,how about change like this
> ", nid, K(...)" -> ",nid, K(xxx)"?

If space is all you're changing, I wouldn't change it.

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +--<mpn@google.com>--<xmpp:mina86@jabber.org>--ooO--(_)--Ooo--

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-12-18 19:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-04  2:54 [PATCH] CMA: add the amount of cma memory in meminfo Xishi Qiu
2014-12-04 16:26 ` Michal Nazarewicz
2014-12-05  1:42   ` Xishi Qiu
2014-12-05 17:41 ` Michal Nazarewicz
2014-12-15  1:37   ` Xishi Qiu
2014-12-18 19:21     ` Michal Nazarewicz

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).