From: Gioh Kim <gioh.kim@lge.com>
To: PINTU KUMAR <pintu.k@samsung.com>,
akpm@linux-foundation.org, riel@redhat.com, aquini@redhat.com,
paul.gortmaker@windriver.com, jmarchan@redhat.com,
lcapitulino@redhat.com, kirill.shutemov@linux.intel.com,
m.szyprowski@samsung.com, aneesh.kumar@linux.vnet.ibm.com,
iamjoonsoo.kim@lge.com, mina86@mina86.com, lauraa@codeaurora.org,
mgorman@suse.de, rientjes@google.com, hannes@cmpxchg.org,
vbabka@suse.cz, sasha.levin@oracle.com,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Cc: pintu_agarwal@yahoo.com, cpgs@samsung.com, vishnu.ps@samsung.com,
rohit.kr@samsung.com, ed.savinay@samsung.com
Subject: Re: [PATCH v2 2/2] fs: proc: Include cma info in proc/meminfo
Date: Fri, 24 Oct 2014 19:10:16 +0900 [thread overview]
Message-ID: <544A2588.40802@lge.com> (raw)
In-Reply-To: <018a01cfef68$88d0b450$9a721cf0$@samsung.com>
2014-10-24 ?AEA 5:57, PINTU KUMAR 3/4 ' +-U:
> Hi,
>
> ----- Original Message -----
>> From: Gioh Kim <gioh.kim@lge.com>
>> To: Pintu Kumar <pintu.k@samsung.com>; akpm@linux-foundation.org;
> riel@redhat.com; aquini@redhat.com; paul.gortmaker@windriver.com;
> jmarchan@redhat.com; lcapitulino@redhat.com;
> kirill.shutemov@linux.intel.com; m.szyprowski@samsung.com;
> aneesh.kumar@linux.vnet.ibm.com; iamjoonsoo.kim@lge.com; mina86@mina86.com;
> lauraa@codeaurora.org; mgorman@suse.de; rientjes@google.com; hannes@cmpxchg.
> org; vbabka@suse.cz; sasha.levin@oracle.com; linux-kernel@vger.kernel.org;
> linux-mm@kvack.org
>> Cc: pintu_agarwal@yahoo.com; cpgs@samsung.com; vishnu.ps@samsung.com;
> rohit.kr@samsung.com; ed.savinay@samsung.com
>> Sent: Thursday, 23 October 2014 5:49 AM
>> Subject: Re: [PATCH v2 2/2] fs: proc: Include cma info in proc/meminfo
>>
>>
>>
>> 2014-10-22 ?AEA 11:06, Pintu Kumar 3/4 ' +-U:
>>> This patch include CMA info (CMATotal, CMAFree) in /proc/meminfo.
>>> Currently, in a CMA enabled system, if somebody wants to know the
>>> total CMA size declared, there is no way to tell, other than the dmesg
>>> or /var/log/messages logs.
>>> With this patch we are showing the CMA info as part of meminfo, so that
>>> it can be determined at any point of time.
>>> This will be populated only when CMA is enabled.
>>>
>>> Below is the sample output from a ARM based device with RAM:512MB and
>> CMA:16MB.
>>>
>>> MemTotal: 471172 kB
>>> MemFree: 111712 kB
>>> MemAvailable: 271172 kB
>>> .
>>> .
>>> .
>>> CmaTotal: 16384 kB
>>> CmaFree: 6144 kB
>>>
>>> This patch also fix below checkpatch errors that were found during these
>> changes.
>>
>> Why don't you split patch for it?
>> I think there's a rule not to mix separate patchs.
>>
>
> Last time when we submitted separate patches for checkpatch errors, it was
> suggested to
> Include these kinds of fixes along with some meaningful patches together.
> So, we included it in same patch.
>
>>>
>>> ERROR: space required after that ',' (ctx:ExV)
>>> 199: FILE: fs/proc/meminfo.c:199:
>>> + ,atomic_long_read(&num_poisoned_pages) << (PAGE_SHIFT -
>> 10)
>>> ^
>>>
>>> ERROR: space required after that ',' (ctx:ExV)
>>> 202: FILE: fs/proc/meminfo.c:202:
>>> + ,K(global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
>>> ^
>>>
>>> ERROR: space required after that ',' (ctx:ExV)
>>> 206: FILE: fs/proc/meminfo.c:206:
>>> + ,K(totalcma_pages)
>>> ^
>>>
>>> total: 3 errors, 0 warnings, 2 checks, 236 lines checked
>>>
>>> Signed-off-by: Pintu Kumar <pintu.k@samsung.com>
>>> Signed-off-by: Vishnu Pratap Singh <vishnu.ps@samsung.com>
>>> ---
>>> fs/proc/meminfo.c | 15 +++++++++++++--
>>> 1 file changed, 13 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
>>> index aa1eee0..d3ebf2e 100644
>>> --- a/fs/proc/meminfo.c
>>> +++ b/fs/proc/meminfo.c
>>> @@ -12,6 +12,9 @@
>>> #include <linux/vmstat.h>
>>> #include <linux/atomic.h>
>>> #include <linux/vmalloc.h>
>>> +#ifdef CONFIG_CMA
>>> +#include <linux/cma.h>
>>> +#endif
>>> #include <asm/page.h>
>>> #include <asm/pgtable.h>
>>> #include "internal.h"
>>> @@ -138,6 +141,10 @@ static int meminfo_proc_show(struct seq_file *m,
> void
>> *v)
>>> #ifdef CONFIG_TRANSPARENT_HUGEPAGE
>>> "AnonHugePages: %8lu kB\n"
>>> #endif
>>> +#ifdef CONFIG_CMA
>>> + "CmaTotal: %8lu kB\n"
>>> + "CmaFree: %8lu kB\n"
>>> +#endif
>>> ,
>>> K(i.totalram),
>>> K(i.freeram),
>>> @@ -187,12 +194,16 @@ 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) *
>>> + , K(global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
>>> HPAGE_PMD_NR)
>>> #endif
>>> +#ifdef CONFIG_CMA
>>> + , K(totalcma_pages)
>>> + , K(global_page_state(NR_FREE_CMA_PAGES))
>>> +#endif
>>> );
>>
>> Just for sure, are zoneinfo and pagetypeinfo not suitable?
>>
>
> I think zoneinfo shows only current free cma pages.
> Same is the case with vmstat.
> # cat /proc/zoneinfo | grep cma
> nr_free_cma 2560
> # cat /proc/vmstat | grep cma
> nr_free_cma 2560
We could add a line to show total cma pages like following and add it all.
# cat /proc/zoneinfo | grep cma
nr_total_cma XXXX
nr_free_cma 2560
Yes. each zone can have cma area and it is annoying to add it all.
But IMO it is rare and not difficult.
And I think it'd better that zoneinfo has nr_total_cma line.
I think you already considered my thoughts and choosed /proc/meminfo for a certain reason.
Why is /proc/meminfo better?
Andrew already accepted it. I'm not against your idea. Just curious.
>
>> I don't know HOTPLUG feature so I'm just asking for sure.
>> Does HOTPLUG not need printing message like this?
>>
>
> Sorry, I am also not sure what hotplug feature you are referring to.
I mean "memory hotplug" feature.
Forget it ;-)
>
>> Thanks a lot.
>>
>>
>>>
>>> hugetlb_report_meminfo(m);
>>>
>>
>> --
>> To unsubscribe, send a message with 'unsubscribe linux-mm' in
>> the body to majordomo@kvack.org. For more info on Linux MM,
>> see: http://www.linux-mm.org/ .
>> Don't email: <a href=mailto:"dont@kvack.org">
>> email@kvack.org </a>
>>
>
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2014-10-24 10:10 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-20 7:33 [PATCH] mm: cma: split cma-reserved in dmesg log Pintu Kumar
2014-10-20 9:35 ` Michal Nazarewicz
2014-10-20 22:48 ` Andrew Morton
2014-10-21 0:47 ` Gioh Kim
2014-10-21 13:21 ` PINTU KUMAR
2014-10-21 23:55 ` Gioh Kim
2014-10-22 14:06 ` [PATCH v2 1/2] " Pintu Kumar
2014-10-22 14:06 ` [PATCH v2 2/2] fs: proc: Include cma info in proc/meminfo Pintu Kumar
2014-10-22 20:00 ` Andrew Morton
2014-10-23 0:19 ` Gioh Kim
2014-10-24 8:57 ` PINTU KUMAR
2014-10-24 10:10 ` Gioh Kim [this message]
2014-10-24 10:43 ` PINTU KUMAR
2014-10-24 16:31 ` Michal Nazarewicz
2014-10-27 23:15 ` Andrew Morton
2014-10-23 17:01 ` [PATCH v2 1/2] mm: cma: split cma-reserved in dmesg log Michal Nazarewicz
2014-10-24 10:30 ` PINTU KUMAR
2014-10-24 16:32 ` Michal Nazarewicz
2014-11-03 23:57 ` David Rientjes
2014-11-04 17:15 ` PINTU KUMAR
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=544A2588.40802@lge.com \
--to=gioh.kim@lge.com \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=aquini@redhat.com \
--cc=cpgs@samsung.com \
--cc=ed.savinay@samsung.com \
--cc=hannes@cmpxchg.org \
--cc=iamjoonsoo.kim@lge.com \
--cc=jmarchan@redhat.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=lauraa@codeaurora.org \
--cc=lcapitulino@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=m.szyprowski@samsung.com \
--cc=mgorman@suse.de \
--cc=mina86@mina86.com \
--cc=paul.gortmaker@windriver.com \
--cc=pintu.k@samsung.com \
--cc=pintu_agarwal@yahoo.com \
--cc=riel@redhat.com \
--cc=rientjes@google.com \
--cc=rohit.kr@samsung.com \
--cc=sasha.levin@oracle.com \
--cc=vbabka@suse.cz \
--cc=vishnu.ps@samsung.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).